Skip to content

Commit 74c685d

Browse files
committed
fix+add new icons, better padding, fancier blurs
1 parent 7532860 commit 74c685d

File tree

14 files changed

+48
-31
lines changed

14 files changed

+48
-31
lines changed

index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,7 @@ button:focus {
5555
input {
5656
@apply appearance-none border border-slate-700 rounded w-full py-2 px-3 bg-slate-800 text-gray-200 leading-tight;
5757
}
58+
59+
.text-shadow {
60+
text-shadow: 0 0 6px #1e293b;
61+
}

src/components/AppIcon.tsx

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ import { FaLock } from 'react-icons/fa';
33
import * as icons from 'simple-icons';
44
import { twJoin } from 'tailwind-merge';
55

6+
import accrue from '../images/accrue.svg?raw';
7+
import amazon from '../images/amazon.svg?raw';
68
import bastillion from '../images/bastillion.png';
79
import betterment from '../images/betterment.png';
810
import carta from '../images/carta.png';
911
import guideline from '../images/guideline.png';
1012
import idme from '../images/id.me.png';
1113
import justworks from '../images/justworks.jpg';
12-
import microsoft from '../images/microsoft.png';
14+
import microsoft from '../images/microsoft.svg?raw';
15+
import nintendo from '../images/nintendo.svg?raw';
1316
import sequoia from '../images/sequoia.png';
14-
import twitter from '../images/twitter.png';
17+
import twitter from '../images/twitter.svg?raw';
1518
import uwcu from '../images/uwcu.png';
1619

1720
enum IconType {
@@ -24,12 +27,12 @@ interface Icon {
2427
hex: string;
2528
title: string;
2629
type: IconType.Icon;
27-
padding?: boolean;
30+
padding?: boolean | string;
2831
}
2932

3033
interface Image {
3134
url: string;
32-
padding?: boolean;
35+
padding?: boolean | string;
3336
type: IconType.Image;
3437
}
3538

@@ -51,6 +54,10 @@ function getIcon(name?: string): Icon | Image | undefined {
5154

5255
// handle one-off cases
5356
switch (name.toLowerCase()) {
57+
case 'accrue':
58+
return { svg: accrue, title: 'Accrue', hex: 'ffffff', padding: 'p-2', type: IconType.Icon };
59+
case 'amazon':
60+
return { svg: amazon, title: 'Amazon', hex: 'ff9900', padding: true, type: IconType.Icon };
5461
case 'bastillion':
5562
return { url: bastillion, padding: true, type: IconType.Image };
5663
case 'betterment':
@@ -66,17 +73,19 @@ function getIcon(name?: string): Icon | Image | undefined {
6673
case 'justworks':
6774
return { url: justworks, type: IconType.Image };
6875
case 'microsoft':
69-
return { url: microsoft, padding: true, type: IconType.Image };
76+
return { svg: microsoft, title: 'Microsoft', hex: '727272', padding: 'p-1.5', type: IconType.Icon };
77+
case 'nintendo':
78+
return { svg: nintendo, title: 'Nintendo', hex: 'dd2020', padding: 'p-1', type: IconType.Icon };
7079
case 'nas':
7180
case 'synology':
72-
return { ...icons.siSynology, type: IconType.Icon };
81+
return { ...icons.siSynology, padding: 'p-1.5', type: IconType.Icon };
7382
case 'uw credit union':
7483
case 'uwcu':
7584
return { url: uwcu, padding: true, type: IconType.Image };
7685
case 'sequoia':
7786
return { url: sequoia, padding: true, type: IconType.Image };
7887
case 'twitter':
79-
return { url: twitter, padding: true, type: IconType.Image };
88+
return { svg: twitter, title: 'Twitter', hex: '00aced', padding: true, type: IconType.Icon };
8089
default:
8190
break;
8291
}
@@ -95,9 +104,6 @@ function getColors(i?: Icon | Image): { background: string; fill?: string } {
95104

96105
// handle one-off cases
97106
switch (icon.title.toLowerCase()) {
98-
case 'amazon':
99-
background = darkColor;
100-
break;
101107
case 'epic games':
102108
fill = 'white';
103109
break;
@@ -122,20 +128,24 @@ export function AppIcon({ name, className }: { name: string; className?: string
122128
' ' +
123129
className;
124130

125-
if (!icon)
131+
if (!icon) {
132+
console.warn(`No icon found for ${name}`);
126133
return (
127134
<div className={imgClass}>
128135
<FaLock />
129136
</div>
130137
);
138+
}
139+
140+
const padding = typeof icon.padding === 'string' ? icon.padding : undefined;
131141

132142
if (icon.type === IconType.Image)
133-
return <img src={icon.url} className={twJoin(imgClass, 'object-cover', icon.padding && 'p-1')} />;
143+
return <img src={icon.url} className={twJoin(imgClass, 'object-cover', padding || (icon.padding && 'p-1'))} />;
134144

135145
return (
136146
<div
137147
dangerouslySetInnerHTML={{ __html: icon.svg }}
138-
className={twJoin(imgClass, icon.padding ? 'p-2.5' : 'p-0.5')}
148+
className={twJoin(imgClass, padding || (icon.padding ? 'p-2.5' : 'p-0.5'))}
139149
style={{ fill: colors.fill }}
140150
/>
141151
);

src/components/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function Modal({
1212
}): JSX.Element {
1313
return (
1414
<div
15-
className="fixed z-30 inset-0 bg-slate-900 bg-opacity-75 flex justify-center items-center"
15+
className="fixed z-30 inset-0 bg-slate-900 bg-opacity-75 flex justify-center items-center backdrop-blur-sm"
1616
onClick={onClose}
1717
onKeyDown={(e) => {
1818
if (e.key === 'Escape') {

src/components/Progress.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function Progress() {
3030
textColor: tailwind.theme.colors.primary,
3131
pathColor: tailwind.theme.colors.primary,
3232
})}
33+
className="text-shadow"
3334
strokeWidth={10}
3435
/>
3536
</div>

src/components/TokenList.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { DocumentReference, updateDoc } from 'firebase/firestore';
22
import { useCallback, useContext, useEffect, useState } from 'react';
33
import { FaSearch } from 'react-icons/fa';
4+
import { twMerge } from 'tailwind-merge';
45
import { useTailwindSize } from '~hooks/useTailwindSize';
56

67
import { CodeContext } from '../contexts/CodeContext';
@@ -32,6 +33,7 @@ export function TokenList({
3233
const encryptionToken = useContext(CodeContext) || '';
3334

3435
const [search, setSearch] = useState('');
36+
const [searchFocused, setSearchFocused] = useState(false);
3537
const [keyToEdit, setKeyToEdit] = useState<Key>();
3638

3739
useEffect(() => {
@@ -79,7 +81,8 @@ export function TokenList({
7981
[encryptionToken, setEditKey, setKeyToEdit]
8082
);
8183

82-
const gridClass = 'w-full grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 sm:gap-6';
84+
const gridClass =
85+
'w-full grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 sm:gap-6 transition-all';
8386

8487
return (
8588
<>
@@ -99,13 +102,20 @@ export function TokenList({
99102
placeholder="Search tokens"
100103
onChange={(e) => setSearch(e.target.value)}
101104
autoFocus
105+
onFocus={() => setSearchFocused(true)}
106+
onBlur={() => setSearchFocused(false)}
102107
/>
103108
<FaSearch className="fill-slate-400 absolute left-3 top-[11px] h-4" />
104109
</div>
105110
</div>
106111

107112
{userData.recentKeys.length > 0 && search.length === 0 && (
108-
<div className="grid gap-4 sm:gap-6 mb-4 sm:mb-6">
113+
<div
114+
className={twMerge(
115+
'grid gap-4 sm:gap-6 mb-4 sm:mb-6 transition-all',
116+
searchFocused && 'opacity-50 blur-sm'
117+
)}
118+
>
109119
<h2 className="m-0 text-xl leading-none">Recently Used</h2>
110120
<div className={gridClass}>
111121
{userData.recentKeys.slice(0, size === 'sm' || size === 'lg' ? 3 : 4).map((name: string) => {
@@ -129,7 +139,7 @@ export function TokenList({
129139
</div>
130140
)}
131141

132-
<div className={gridClass}>
142+
<div className={twMerge(gridClass, searchFocused && search.length === 0 && 'opacity-50 blur-sm')}>
133143
{userData.keys
134144
.filter(
135145
(k) => (search.length === 0 || k.name.toLowerCase().includes(search.toLowerCase())) && !k.archived

src/images/accrue.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/amazon.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/microsoft.png

-1.08 KB
Binary file not shown.

src/images/microsoft.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/nintendo.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)