Skip to content

Commit

Permalink
update icons
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdenio committed Mar 7, 2024
1 parent ddc12fa commit c78ccc0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
Binary file added assets/icons/cash-money.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file removed assets/icons/primary.png
Binary file not shown.
6 changes: 3 additions & 3 deletions src/lib/AppIconList.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-env commonjs */

const appIcons = {
Primary: "primary.png",
Dev: "dev.png",
"Open Late": "hack_night.png",
Default: "default.png",
"Cash Money": "cash-money.png",
"Open Late": "hack-night.png",
};

let appIconConfig = {};
Expand Down
38 changes: 25 additions & 13 deletions src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ import { discovery } from "./login";

const IconComponent = ({
name,
displayName = name,
currentIcon,
last,
onPress,
}: {
name: string;
displayName?: string;
currentIcon: string;
last?: boolean;
onPress: (name: string) => void;
}) => {
const source = { uri: `${name}-Icon-60x60` };
Expand All @@ -43,7 +47,7 @@ const IconComponent = ({
style={{ width: 50, height: 50, borderRadius: 10 }}
/>
<Text style={{ fontSize: 18, marginBottom: 0, color: palette.smoke }}>
{name}
{displayName}
</Text>
<Ionicons
name={selected ? "checkmark-circle" : "checkmark-circle-outline"}
Expand All @@ -52,14 +56,16 @@ const IconComponent = ({
marginLeft="auto"
/>
</View>
<View
style={{
height: 0.5,
width: "100%",
marginLeft: "15%",
backgroundColor: palette.slate,
}}
></View>
{!last && (
<View
style={{
height: 0.5,
width: "100%",
marginLeft: "15%",
backgroundColor: palette.slate,
}}
></View>
)}
</Pressable>
);
};
Expand Down Expand Up @@ -100,7 +106,7 @@ const ListHeader = ({ title }: { title: string }) => {
return (
<Text
style={{
fontSize: 24,
fontSize: 18,
marginBottom: 16,
color: palette.smoke,
}}
Expand All @@ -118,7 +124,10 @@ export default function SettingsPage(
const [appIcon, setAppIcon] = useState<string>("");

useEffect(() => {
AppIcon.getIconName(({ iconName }) => setAppIcon(iconName));
AppIcon.getIconName(({ iconName }) => {
if (iconName == "default") iconName = "Default"; // don't hate me 'cause you ain't me
setAppIcon(iconName);
});
}, []);

const { data: user } = useSWR<User>("/user");
Expand All @@ -140,12 +149,14 @@ export default function SettingsPage(
<IconComponent
onPress={handleClick}
currentIcon={appIcon}
name="Primary"
name="Default"
displayName="Classic"
/>
<IconComponent
onPress={handleClick}
currentIcon={appIcon}
name="Dev"
name="Cash Money"
last
/>
</ListSection>
<ListHeader title="Shiny- catchem all!" />
Expand All @@ -154,6 +165,7 @@ export default function SettingsPage(
onPress={handleClick}
currentIcon={appIcon}
name="Open Late"
last
/>
</ListSection>
</View>
Expand Down

0 comments on commit c78ccc0

Please sign in to comment.