Skip to content

Commit

Permalink
Move subscribed icon setting to Appearance, increase icons size (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Aug 11, 2024
1 parent b8f305c commit 352c670
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/features/labels/links/CommunityLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const StyledItemIcon = styled(ItemIcon)`
const SubscribedIcon = styled(IonIcon)`
color: var(--ion-color-danger);
vertical-align: middle;
font-size: 0.85em;
margin-bottom: 1px;
margin-left: 2px;
Expand Down Expand Up @@ -163,7 +162,7 @@ const onStart: LongPressOptions["onStart"] = (e) => {
function useShowSubscribedIcon() {
const feedEnabled = useContext(ShowSubscribedIconContext);
const subscribedIcon = useAppSelector(
(state) => state.settings.general.subscribedIcon,
(state) => state.settings.appearance.posts.subscribedIcon,
);

switch (subscribedIcon) {
Expand Down
4 changes: 3 additions & 1 deletion src/features/settings/appearance/posts/Posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import EmbedExternalMedia from "./EmbedExternalMedia";
import AlwaysShowAuthor from "./AlwaysShowAuthor";
import RememberType from "./RememberType";
import CommunityAtTop from "./CommunityAtTop";
import SubscribedIcon from "./SubscribedIcon";

export default function Posts() {
return (
Expand All @@ -20,10 +21,11 @@ export default function Posts() {
<RememberType />
<BlurNsfw />
<CommunityAtTop />
<EmbedCrossposts />
<EmbedExternalMedia />
<ShowCommunityIcons />
<SubscribedIcon />
<AlwaysShowAuthor />
<EmbedCrossposts />
</IonList>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SettingSelector from "../../shared/SettingSelector";

export default function SubscribedIcon() {
const subscribedIcon = useAppSelector(
(state) => state.settings.general.subscribedIcon,
(state) => state.settings.appearance.posts.subscribedIcon,
);

return (
Expand Down
2 changes: 0 additions & 2 deletions src/features/settings/general/other/Other.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import OpenNativeApps from "./OpenNativeApps";
import ClearCache from "./ClearCache";
import BackupSettings from "./backup/BackupSettings";
import Thumbnailinator from "./Thumbnailinator";
import SubscribedIcon from "./SubscribedIcon";

export default function Other() {
return (
Expand All @@ -25,7 +24,6 @@ export default function Other() {
<Haptics />
<NoSubscribedInFeed />
<Thumbnailinator />
<SubscribedIcon />
<ClearCache />
<BackupSettings />
</IonList>
Expand Down
10 changes: 5 additions & 5 deletions src/features/settings/settingsSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ interface SettingsState {
embedExternalMedia: boolean;
alwaysShowAuthor: boolean;
communityAtTop: boolean;
subscribedIcon: ShowSubscribedIcon;
};
large: {
showVotingButtons: boolean;
Expand Down Expand Up @@ -138,7 +139,6 @@ interface SettingsState {
defaultFeed: DefaultFeedType | undefined;
noSubscribedInFeed: boolean;
thumbnailinatorEnabled: boolean;
subscribedIcon: ShowSubscribedIcon;
};
blocks: {
keywords: string[];
Expand Down Expand Up @@ -167,6 +167,7 @@ export const initialState: SettingsState = {
embedExternalMedia: true,
alwaysShowAuthor: false,
communityAtTop: false,
subscribedIcon: OShowSubscribedIcon.Never,
},
large: {
showVotingButtons: true,
Expand Down Expand Up @@ -226,7 +227,6 @@ export const initialState: SettingsState = {
defaultFeed: undefined,
noSubscribedInFeed: false,
thumbnailinatorEnabled: true,
subscribedIcon: OShowSubscribedIcon.Never,
},
blocks: {
keywords: [],
Expand Down Expand Up @@ -543,7 +543,7 @@ export const appearanceSlice = createSlice({
db.setSetting("prefer_native_apps", action.payload);
},
setSubscribedIcon(state, action: PayloadAction<ShowSubscribedIcon>) {
state.general.subscribedIcon = action.payload;
state.appearance.posts.subscribedIcon = action.payload;

db.setSetting("subscribed_icon", action.payload);
},
Expand Down Expand Up @@ -805,6 +805,8 @@ export const fetchSettingsFromDatabase = createAsyncThunk<SettingsState>(
initialState.appearance.posts.alwaysShowAuthor,
communityAtTop:
community_at_top ?? initialState.appearance.posts.communityAtTop,
subscribedIcon:
subscribed_icon ?? initialState.appearance.posts.subscribedIcon,
},
large: {
showVotingButtons:
Expand Down Expand Up @@ -906,8 +908,6 @@ export const fetchSettingsFromDatabase = createAsyncThunk<SettingsState>(
thumbnailinatorEnabled:
thumbnailinator_enabled ??
initialState.general.thumbnailinatorEnabled,
subscribedIcon:
subscribed_icon ?? initialState.general.subscribedIcon,
},
blocks: {
keywords: filtered_keywords ?? initialState.blocks.keywords,
Expand Down

0 comments on commit 352c670

Please sign in to comment.