mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
adds icons to topics bar
This commit is contained in:
parent
7b5f9f0360
commit
405aa0c942
3 changed files with 10 additions and 7 deletions
|
|
@ -2,13 +2,8 @@ import React from 'react';
|
||||||
import { name } from 'country-emoji';
|
import { name } from 'country-emoji';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Tag, Tags } from './Topics';
|
import { Tag, Tags } from './Topics';
|
||||||
import iphone from '../images/iphone.png';
|
import * as icons from '../util/icons';
|
||||||
import android from '../images/android.png';
|
|
||||||
import windows from '../images/windows.svg';
|
|
||||||
import apple from '../images/apple.svg';
|
|
||||||
import linux from '../images/linux.svg';
|
|
||||||
|
|
||||||
const icons = { iphone, android, windows, apple, linux };
|
|
||||||
export default function Person({ person, currentTag }) {
|
export default function Person({ person, currentTag }) {
|
||||||
const url = new URL(person.url);
|
const url = new URL(person.url);
|
||||||
const img = `https://logo.clearbit.com/${url.host}`;
|
const img = `https://logo.clearbit.com/${url.host}`;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import FilterContext from '../context/FilterContext';
|
import FilterContext from '../context/FilterContext';
|
||||||
|
import * as icons from '../util/icons';
|
||||||
|
|
||||||
export default function Topics() {
|
export default function Topics() {
|
||||||
const { countries, tags, devices, currentTag, setCurrentTag } = useContext(
|
const { countries, tags, devices, currentTag, setCurrentTag } = useContext(
|
||||||
|
|
@ -63,7 +64,7 @@ export default function Topics() {
|
||||||
checked={tag.name === currentTag}
|
checked={tag.name === currentTag}
|
||||||
onChange={e => setCurrentTag(e.currentTarget.value)}
|
onChange={e => setCurrentTag(e.currentTarget.value)}
|
||||||
/>
|
/>
|
||||||
{tag.name}
|
<img height="20px" src={icons[tag.name]} alt={tag.name} />
|
||||||
<TagCount>{tag.count}</TagCount>
|
<TagCount>{tag.count}</TagCount>
|
||||||
</Tag>
|
</Tag>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import iphone from '../images/iphone.png';
|
||||||
|
import android from '../images/android.png';
|
||||||
|
import windows from '../images/windows.svg';
|
||||||
|
import apple from '../images/apple.svg';
|
||||||
|
import linux from '../images/linux.svg';
|
||||||
|
|
||||||
|
export { iphone, android, windows, apple, linux };
|
||||||
Loading…
Reference in a new issue