Skip to content

Commit 7d90ea5

Browse files
authored
fix: 404 errors on static images used in menu
1 parent ac63d40 commit 7d90ea5

File tree

2 files changed

+24
-33
lines changed

2 files changed

+24
-33
lines changed

src/components/nav/MainNav.tsx

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import NavItem from './NavItem'
55
import Product from './Product'
66
import * as MenuColumn from './MenuColumn'
77
import useGetLastPost from 'hooks/use-get-last-post'
8-
import Traefikhubicon from '../../images/Traefikhub.svg'
9-
import Traefikicon from '../../images/Traefik-Hub.svg'
10-
import Traefikproxyicon from '../../images/TraefikProxy.svg'
11-
import TraefikEnterpriseicon from '../../images/TraefikEnterprise.svg'
12-
import ApiGatewayIcon from '../../images/APIGateway.svg'
13-
import APIManagementIcon from '../../images/APIManagement.svg'
14-
import DockerSwarmIcon from '../../images/DockerSwarmIngress.svg'
15-
import KubernetesIcon from '../../images/KubernetesIngress.svg'
8+
import { ReactComponent as TraefikHubIcon } from '../../images/Traefikhub.svg'
9+
import { ReactComponent as TraefikIcon } from '../../images/Traefik-Hub.svg'
10+
import { ReactComponent as TraefikProxyIcon } from '../../images/TraefikProxy.svg'
11+
import { ReactComponent as TraefikEnterpriseIcon } from '../../images/TraefikEnterprise.svg'
12+
import { ReactComponent as ApiGatewayIcon } from '../../images/APIGateway.svg'
13+
import { ReactComponent as APIManagementIcon } from '../../images/APIManagement.svg'
14+
import { ReactComponent as DockerSwarmIcon } from '../../images/DockerSwarmIngress.svg'
15+
import { ReactComponent as KubernetesIcon } from '../../images/KubernetesIngress.svg'
1616
import { ReactComponent as BlogIcon } from '../../images/menu_icons_blog.svg'
1717
import { ReactComponent as ResourcesIcon } from '../../images/menu_icons_resources.svg'
1818
import { ReactComponent as TraefikAcademyIcon } from '../../images/menu_icons_academy.svg'
@@ -25,9 +25,6 @@ import { ReactComponent as CommunityIcon } from '../../images/menu_icons_communi
2525
import { ReactComponent as ProxyIcon } from '../../images/menu_icons_traefik_proxy.svg'
2626
import { ReactComponent as EnterpriseIcon } from '../../images/menu_icons_traefik_enterprise.svg'
2727
import { ReactComponent as HubIcon } from '../../images/menu_icons_traefik_hub.svg'
28-
import BgImg1 from '../../images/[email protected]'
29-
import BgImg2 from '../../images/[email protected]'
30-
import BgImg3 from '../../images/[email protected]'
3128
import PostCard from './PostCard'
3229

3330
const Wrapper = styled(Flex)`
@@ -56,10 +53,10 @@ const MainNav = () => {
5653
url: 'https://traefik.io/traefik/',
5754
external: true,
5855
description: 'OSS Cloud-Native Application Proxy',
59-
icon: Traefikproxyicon,
56+
icon: <TraefikProxyIcon />,
6057
},
6158
]}
62-
bgImage={BgImg3}
59+
bgImage={'https://traefik.io/images/site-nav/[email protected]'}
6360
/>
6461
<Product
6562
title="API Gateway"
@@ -72,17 +69,17 @@ const MainNav = () => {
7269
external: true,
7370
description: 'Seamless Upgrade from Traefik Proxy',
7471
tagColor: 'rgb(177,64,245)',
75-
icon: Traefikicon,
72+
icon: <TraefikIcon />,
7673
},
7774
{
7875
title: 'Traefik Enterprise',
7976
url: 'https://traefik.io/traefik-enterprise/',
8077
external: true,
8178
description: 'Standalone General-Purpose API Gateway',
82-
icon: TraefikEnterpriseicon,
79+
icon: <TraefikEnterpriseIcon />,
8380
},
8481
]}
85-
bgImage={BgImg1}
82+
bgImage={'https://traefik.io/images/site-nav/[email protected]'}
8683
/>
8784
<Product
8885
title="API Management"
@@ -94,10 +91,10 @@ const MainNav = () => {
9491
external: true,
9592
tag: 'API Management',
9693
description: 'Kubernetes-Native API Management',
97-
icon: Traefikhubicon,
94+
icon: <TraefikHubIcon />,
9895
},
9996
]}
100-
bgImage={BgImg2}
97+
bgImage={'https://traefik.io/images/site-nav/[email protected]'}
10198
/>
10299
</Grid>
103100
</NavItem>
@@ -118,17 +115,17 @@ const MainNav = () => {
118115
url: 'https://traefik.io/solutions/kubernetes-ingress/',
119116
external: true,
120117
description: 'A centralized routing solution for your Kubernetes deployment.',
121-
icon: KubernetesIcon,
118+
icon: <KubernetesIcon />,
122119
},
123120
{
124121
title: 'Docker Swarm Ingress',
125122
url: 'https://traefik.io/solutions/docker-swarm-ingress/',
126123
external: true,
127124
description: 'Manage incoming network traffic across your cluster',
128-
icon: DockerSwarmIcon,
125+
icon: <DockerSwarmIcon />,
129126
},
130127
]}
131-
bgImage={BgImg3}
128+
bgImage={'https://traefik.io/images/site-nav/[email protected]'}
132129
/>
133130
<Product
134131
title="API Gateway"
@@ -138,10 +135,10 @@ const MainNav = () => {
138135
url: 'https://traefik.io/solutions/api-gateway/',
139136
external: true,
140137
description: 'Centralize security and routing in a single entry point for microservices deployments.',
141-
icon: APIManagementIcon,
138+
icon: <APIManagementIcon />,
142139
},
143140
]}
144-
bgImage={BgImg1}
141+
bgImage={'https://traefik.io/images/site-nav/[email protected]'}
145142
/>
146143
<Product
147144
title="API Management"
@@ -151,10 +148,10 @@ const MainNav = () => {
151148
url: 'https://traefik.io/solutions/api-management/',
152149
external: true,
153150
description: 'Simplifies and Accelerates API lifecycle management.',
154-
icon: ApiGatewayIcon,
151+
icon: <ApiGatewayIcon />,
155152
},
156153
]}
157-
bgImage={BgImg2}
154+
bgImage={'https://traefik.io/images/site-nav/[email protected]'}
158155
/>
159156
</Grid>
160157
</NavItem>

src/components/nav/Product.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type NavProductProps = {
99
links?: {
1010
title: string
1111
url: string
12-
icon: string
12+
icon: any
1313
description: string
1414
tagColor?: string
1515
tag?: string
@@ -62,9 +62,7 @@ const Product = ({ bgImage, title, description, links }: NavProductProps) => (
6262
links.map((link) => (
6363
<li key={title + link.title}>
6464
<NavbarLink external={link.external} url={link.url}>
65-
<NavLinkIcon>
66-
<img src={link.icon} aria-hidden="true" width={24} height={24} alt="" />
67-
</NavLinkIcon>
65+
<NavLinkIcon>{link.icon}</NavLinkIcon>
6866
<div>
6967
<NavLinkTitle>
7068
<span>{link.title}</span>
@@ -121,10 +119,6 @@ const Links = styled.ul`
121119
&:hover {
122120
background-color: #f4f5f6;
123121
}
124-
125-
svg {
126-
margin-right: 8px;
127-
}
128122
}
129123
`
130124
const NavLinkIcon = styled.div`

0 commit comments

Comments
 (0)