mobile: minor fixes in settings

This commit is contained in:
Ammar Ahmed
2026-07-16 01:00:16 +05:00
parent fbc36a15ba
commit dc7b863720
7 changed files with 41 additions and 44 deletions

View File

@@ -157,7 +157,7 @@ export default function PaywallSheet<Tid extends FeatureId>(props: {
style={{
width: "100%",
paddingHorizontal: Spacing.LEVEL_3,
paddingVertical: Spacing.LEVEL_4,
paddingTop: Spacing.LEVEL_4,
gap: Spacing.LEVEL_3
}}
>

View File

@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { ScopedThemeProvider, useThemeColors } from "@notesnook/theme";
import React, { useEffect, useRef } from "react";
import { Platform, View } from "react-native";
import { Platform } from "react-native";
import ActionSheet from "react-native-actions-sheet";
import useGlobalSafeAreaInsets from "../../../hooks/use-global-safe-area-insets";
import { useSettingStore } from "../../../stores/use-setting-store";
@@ -161,14 +161,6 @@ const SheetWrapper = ({
onClose={_onClose}
>
{children}
{bottomPadding ? (
<View
style={{
height: 10
}}
/>
) : null}
</ActionSheet>
</ScopedThemeProvider>
);

View File

@@ -166,11 +166,12 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {
justifyContent: "space-between",
paddingHorizontal: Spacing.LEVEL_3,
paddingVertical: item.component && !item.name ? 0 : Spacing.LEVEL_1,
borderRadius: Radius.S,
backgroundColor: colors.primary.background,
borderRadius: 0,
marginBottom: Spacing.LEVEL_0,
overflow: "hidden"
}}
type="transparent"
noborder
onPress={async () => {
if (!checkIsFeatureAvailable()) return;
if (isDisabled) return;
@@ -267,7 +268,7 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {
{!isFeatureAvailable?.isAllowed ? (
<View
style={{
paddingVertical: Spacing.LEVEL_0 / 2,
paddingVertical: Spacing.LEVEL_0,
paddingHorizontal: Spacing.LEVEL_1,
borderRadius: 100,
backgroundColor: colors.primary.accent,
@@ -279,8 +280,9 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {
>
<AppIcon
color={colors.static.orange}
size={AppFontSize.md}
name="crown"
size={10}
name="crown-simple"
iconFamily="notesnook"
/>
{isFeatureAvailable?.availableOn ? (
<Paragraph
@@ -288,7 +290,7 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {
fontSize="XXS"
fontFamily="MEDIUM"
>
{planToDisplayNameShort(isFeatureAvailable?.availableOn)}
Pro
</Paragraph>
) : null}
</View>
@@ -299,7 +301,7 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {
<Paragraph
color={colors.primary.paragraph}
fontSize="SM"
lineHeight="100%"
lineHeight="110%"
>
{typeof item.description === "function"
? item.description(current)
@@ -308,31 +310,41 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {
) : null}
</View>
{item.type === "switch" && !loading && (
<AppIcon
name={isOn ? "toggle-on" : "toggle-off"}
iconFamily="notesnook"
size={16}
color={
isOn
? [colors.primary.accent, colors.primary.background]
: [colors.disabled.icon, colors.primary.background]
}
/>
)}
{loading || item.type === "switch" ? (
<View
style={{
width: 26,
height: 26,
alignItems: "center",
justifyContent: "center"
}}
>
{item.type === "switch" && !loading && (
<AppIcon
name={isOn ? "toggle-on" : "toggle-off"}
iconFamily="notesnook"
size={16}
color={
isOn
? [colors.primary.accent, colors.primary.accentForeground]
: [colors.disabled.icon, colors.primary.background]
}
/>
)}
{loading ? (
<ActivityIndicator size={16} color={colors.primary.accent} />
) : null}
</View>
) : null}
{item.type === "screen" ? (
<AppIcon
name="chevron-right"
iconFamily="notesnook"
size={16}
color={colors.secondary.paragraph}
color={colors.primary.icon}
/>
) : null}
{loading ? (
<ActivityIndicator size={16} color={colors.primary.accent} />
) : null}
</View>
<View

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,3 @@
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="GithubLogo" clip-path="url(#clip0_0_19)">
<path id="Vector" d="M13.0194 4.73C13.1722 4.237 13.2212 3.71768 13.1634 3.20478C13.1055 2.69189 12.942 2.19655 12.6831 1.75C12.6392 1.67397 12.5761 1.61084 12.5001 1.56696C12.424 1.52307 12.3378 1.49998 12.25 1.5C11.6676 1.49878 11.093 1.63379 10.5721 1.89424C10.0512 2.15469 9.59845 2.53336 9.25 3H7.75C7.40155 2.53336 6.94878 2.15469 6.42788 1.89424C5.90698 1.63379 5.33238 1.49878 4.75 1.5C4.66221 1.49998 4.57597 1.52307 4.49994 1.56696C4.42391 1.61084 4.36077 1.67397 4.31687 1.75C4.05803 2.19655 3.89452 2.69189 3.83664 3.20478C3.77877 3.71768 3.82779 4.237 3.98062 4.73C3.6717 5.2692 3.50623 5.87861 3.5 6.5V7C3.50105 7.846 3.80817 8.66305 4.36464 9.30028C4.92111 9.93751 5.68935 10.3519 6.5275 10.4669C6.18538 10.9047 5.99968 11.4444 6 12V12.5H4.5C4.10218 12.5 3.72064 12.342 3.43934 12.0607C3.15804 11.7794 3 11.3978 3 11C3 10.6717 2.93534 10.3466 2.8097 10.0433C2.68406 9.73998 2.49991 9.46438 2.26777 9.23223C2.03562 9.00009 1.76002 8.81594 1.45671 8.6903C1.15339 8.56466 0.828305 8.5 0.5 8.5C0.367392 8.5 0.240215 8.55268 0.146447 8.64645C0.0526784 8.74022 0 8.86739 0 9C0 9.13261 0.0526784 9.25979 0.146447 9.35355C0.240215 9.44732 0.367392 9.5 0.5 9.5C0.897825 9.5 1.27936 9.65804 1.56066 9.93934C1.84196 10.2206 2 10.6022 2 11C2 11.663 2.26339 12.2989 2.73223 12.7678C3.20107 13.2366 3.83696 13.5 4.5 13.5H6V14.5C6 14.6326 6.05268 14.7598 6.14645 14.8536C6.24021 14.9473 6.36739 15 6.5 15C6.63261 15 6.75979 14.9473 6.85355 14.8536C6.94732 14.7598 7 14.6326 7 14.5V12C7 11.6022 7.15804 11.2206 7.43934 10.9393C7.72064 10.658 8.10218 10.5 8.5 10.5C8.89782 10.5 9.27936 10.658 9.56066 10.9393C9.84196 11.2206 10 11.6022 10 12V14.5C10 14.6326 10.0527 14.7598 10.1464 14.8536C10.2402 14.9473 10.3674 15 10.5 15C10.6326 15 10.7598 14.9473 10.8536 14.8536C10.9473 14.7598 11 14.6326 11 14.5V12C11.0003 11.4444 10.8146 10.9047 10.4725 10.4669C11.3107 10.3519 12.0789 9.93751 12.6354 9.30028C13.1918 8.66305 13.4989 7.846 13.5 7V6.5C13.4938 5.87861 13.3283 5.2692 13.0194 4.73ZM12.5 7C12.5 7.66304 12.2366 8.29893 11.7678 8.76777C11.2989 9.23661 10.663 9.5 10 9.5H7C6.33696 9.5 5.70107 9.23661 5.23223 8.76777C4.76339 8.29893 4.5 7.66304 4.5 7V6.5C4.50613 6.00002 4.65582 5.51233 4.93125 5.095C4.98259 5.02732 5.01585 4.94768 5.02788 4.86359C5.03991 4.7795 5.03031 4.69373 5 4.61438C4.86976 4.2785 4.80709 3.92022 4.81556 3.56008C4.82403 3.19994 4.90349 2.84501 5.04938 2.51563C5.45857 2.55965 5.85262 2.6952 6.2023 2.91223C6.55198 3.12927 6.84832 3.42222 7.06938 3.76938C7.11442 3.83982 7.17641 3.89784 7.24968 3.93813C7.32294 3.97842 7.40514 3.99969 7.48875 4H9.51062C9.59455 4 9.67713 3.97888 9.75075 3.93857C9.82437 3.89827 9.88666 3.84008 9.93188 3.76938C10.1529 3.42219 10.4492 3.12921 10.7989 2.91217C11.1486 2.69513 11.5427 2.5596 11.9519 2.51563C12.0976 2.84509 12.1768 3.20006 12.1851 3.5602C12.1933 3.92035 12.1304 4.27858 12 4.61438C11.9698 4.69297 11.9597 4.77787 11.9706 4.86137C11.9815 4.94486 12.0131 5.02431 12.0625 5.0925C12.3407 5.50983 12.4926 5.99852 12.5 6.5V7Z" fill="var(--fill-0, #181818)"/>
</g>
<defs>
<clipPath id="clip0_0_19">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.0194 4.73001C13.1722 4.23701 13.2212 3.71768 13.1634 3.20479C13.1055 2.6919 12.942 2.19656 12.6831 1.75001C12.6392 1.67398 12.5761 1.61085 12.5001 1.56697C12.424 1.52308 12.3378 1.49999 12.25 1.50001C11.6676 1.49879 11.093 1.6338 10.5721 1.89425C10.0512 2.1547 9.59845 2.53337 9.25 3.00001H7.75C7.40155 2.53337 6.94878 2.1547 6.42788 1.89425C5.90698 1.6338 5.33238 1.49879 4.75 1.50001C4.66221 1.49999 4.57597 1.52308 4.49994 1.56697C4.4239 1.61085 4.36077 1.67398 4.31687 1.75001C4.05803 2.19656 3.89452 2.6919 3.83664 3.20479C3.77877 3.71768 3.8278 4.23701 3.98062 4.73001C3.6717 5.26921 3.50623 5.87862 3.5 6.50001V7.00001C3.50105 7.84601 3.80817 8.66306 4.36464 9.30029C4.92111 9.93752 5.68935 10.3519 6.5275 10.4669C6.18538 10.9047 5.99968 11.4444 6 12V12.5H4.5C4.10218 12.5 3.72064 12.342 3.43934 12.0607C3.15804 11.7794 3 11.3978 3 11C3 10.6717 2.93534 10.3466 2.8097 10.0433C2.68406 9.73999 2.49991 9.46439 2.26777 9.23224C2.03562 9.0001 1.76002 8.81595 1.45671 8.69031C1.15339 8.56467 0.828305 8.50001 0.5 8.50001C0.367392 8.50001 0.240215 8.55269 0.146447 8.64646C0.0526784 8.74022 0 8.8674 0 9.00001C0 9.13262 0.0526784 9.25979 0.146447 9.35356C0.240215 9.44733 0.367392 9.50001 0.5 9.50001C0.897825 9.50001 1.27936 9.65804 1.56066 9.93935C1.84196 10.2207 2 10.6022 2 11C2 11.6631 2.26339 12.2989 2.73223 12.7678C3.20107 13.2366 3.83696 13.5 4.5 13.5H6V14.5C6 14.6326 6.05268 14.7598 6.14645 14.8536C6.24021 14.9473 6.36739 15 6.5 15C6.63261 15 6.75979 14.9473 6.85355 14.8536C6.94732 14.7598 7 14.6326 7 14.5V12C7 11.6022 7.15804 11.2207 7.43934 10.9393C7.72064 10.658 8.10218 10.5 8.5 10.5C8.89782 10.5 9.27936 10.658 9.56066 10.9393C9.84196 11.2207 10 11.6022 10 12V14.5C10 14.6326 10.0527 14.7598 10.1464 14.8536C10.2402 14.9473 10.3674 15 10.5 15C10.6326 15 10.7598 14.9473 10.8536 14.8536C10.9473 14.7598 11 14.6326 11 14.5V12C11.0003 11.4444 10.8146 10.9047 10.4725 10.4669C11.3107 10.3519 12.0789 9.93752 12.6354 9.30029C13.1918 8.66306 13.4989 7.84601 13.5 7.00001V6.50001C13.4938 5.87862 13.3283 5.26921 13.0194 4.73001ZM12.5 7.00001C12.5 7.66305 12.2366 8.29893 11.7678 8.76778C11.2989 9.23662 10.663 9.50001 10 9.50001H7C6.33696 9.50001 5.70107 9.23662 5.23223 8.76778C4.76339 8.29893 4.5 7.66305 4.5 7.00001V6.50001C4.50613 6.00002 4.65582 5.51233 4.93125 5.09501C4.98259 5.02733 5.01585 4.94769 5.02788 4.8636C5.03991 4.77951 5.03031 4.69374 5 4.61438C4.86976 4.27851 4.80709 3.92023 4.81556 3.56009C4.82403 3.19995 4.90349 2.84501 5.04938 2.51563C5.45857 2.55965 5.85262 2.69521 6.2023 2.91224C6.55198 3.12928 6.84832 3.42223 7.06938 3.76938C7.11442 3.83982 7.17641 3.89784 7.24968 3.93813C7.32294 3.97842 7.40514 3.9997 7.48875 4.00001H9.51062C9.59455 4.00001 9.67713 3.97889 9.75075 3.93858C9.82437 3.89828 9.88666 3.84009 9.93188 3.76938C10.1529 3.4222 10.4492 3.12922 10.7989 2.91218C11.1486 2.69514 11.5427 2.55961 11.9519 2.51563C12.0976 2.8451 12.1768 3.20007 12.1851 3.56021C12.1933 3.92036 12.1304 4.27859 12 4.61438C11.9698 4.69298 11.9597 4.77788 11.9706 4.86138C11.9815 4.94487 12.0131 5.02432 12.0625 5.09251C12.3407 5.50984 12.4926 5.99853 12.5 6.50001V7.00001Z" fill="#181818"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB