Skip to content

Commit

Permalink
Added icons for technologies
Browse files Browse the repository at this point in the history
  • Loading branch information
abstractalgo committed Nov 16, 2021
1 parent e058686 commit db1bfd0
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 8 deletions.
18 changes: 16 additions & 2 deletions components/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ import { CONSTANTS } from '../utils/constants';

const TechSelect = Select.ofType<Technology>();

const TechItem: FC<{ tech: Technology }> = ({ tech }) => (
<div
style={{
display: 'grid',
gridAutoFlow: 'column',
gridAutoColumns: 'max-content',
columnGap: '4px',
}}
>
<img src={TechMeta[tech].icon} width={16} height={16} />{' '}
{TechMeta[tech].label}
</div>
);

type ColumnProps = {
topic: Topic;
availableTechs: Technology[];
Expand Down Expand Up @@ -47,7 +61,7 @@ export const Column: FC<ColumnProps> = ({
key={techItem}
selected={active}
onClick={handleClick}
text={TechMeta[techItem].label}
text={<TechItem tech={techItem} />}
/>
)}
onItemSelect={(techItem) => onSelect(techItem)}
Expand All @@ -61,7 +75,7 @@ export const Column: FC<ColumnProps> = ({
}}
>
<Button
text={tech ? TechMeta[tech].label : 'Select tech...'}
text={tech ? <TechItem tech={tech} /> : 'Select tech...'}
small
outlined
rightIcon="caret-down"
Expand Down
Binary file added public/tech-icons/go.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tech-icons/java.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tech-icons/js.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tech-icons/python.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tech-icons/rust.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tech-icons/ts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions utils/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ export const TechMeta: Record<
// alternative names that will be used while filtering with query
// (these ids aren't used in the formation of the URL)
alt?: string[];
// icons
icon: string;
}
> = {
js: { label: 'JavaScript', alt: ['javascript'] },
ts: { label: 'Typescript', alt: ['typescript'] },
go: { label: 'Go', alt: ['golang'] },
python: { label: 'Python', alt: ['py'] },
rust: { label: 'Rust', alt: ['rs'] },
java: { label: 'Java' },
js: { label: 'JavaScript', alt: ['javascript'], icon: '/tech-icons/js.png' },
ts: { label: 'Typescript', alt: ['typescript'], icon: '/tech-icons/ts.png' },
go: { label: 'Go', alt: ['golang'], icon: '/tech-icons/go.png' },
python: { label: 'Python', alt: ['py'], icon: '/tech-icons/python.png' },
rust: { label: 'Rust', alt: ['rs'], icon: '/tech-icons/rust.png' },
java: { label: 'Java', icon: '/tech-icons/java.png' },
};

1 comment on commit db1bfd0

@vercel
Copy link

@vercel vercel bot commented on db1bfd0 Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.