Skip to content

Commit 47ee9f6

Browse files
committed
Define base path for assets
1 parent 596812d commit 47ee9f6

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import theme from './theme'
55

66
export default function App() {
77
return(
8-
<BrowserRouter>
8+
<BrowserRouter basename='/website2.0'>
99
<ThemeProvider theme={theme}>
1010
<Router/>
1111
</ThemeProvider>

src/Home.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import { type ReactElement } from 'react'
22
import { Box, Container, Avatar, IconButton, Link } from '@mui/material'
33
import FacebookIcon from '@mui/icons-material/Facebook'
44
import InstagramIcon from '@mui/icons-material/Instagram'
5-
import TwitterIcon from '@mui/icons-material/Twitter'
5+
import XIcon from '@mui/icons-material/X'
66
import LinkedInIcon from '@mui/icons-material/LinkedIn'
77
import EmailIcon from '@mui/icons-material/Email'
88
import PatreonIcon from './PatreonIcon'
99
import NavBar from './NavBar';
10-
const LOGO = 'src/assets/images/logo.png'
10+
import logo from './assets/images/logo.png'
1111

1212
const Home = (): ReactElement => {
1313
return (
1414
<>
1515
<NavBar />
1616
<Container sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
1717
<Box sx={{ display: 'flex', justifyContent: 'center', marginTop: '100px', padding: 3 }}>
18-
<Avatar src={LOGO} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '500px' }} />
18+
<Avatar src={logo} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '500px' }} />
1919
</Box>
2020
<Box>
2121
<IconButton component={Link} href="https://www.facebook.com/ColimaWebDevTalks" target="_blank">
@@ -25,7 +25,7 @@ const Home = (): ReactElement => {
2525
<InstagramIcon fontSize="large" />
2626
</IconButton>
2727
<IconButton component={Link} href="https://twitter.com/webdevtalksmx" target="_blank">
28-
<TwitterIcon fontSize="large" />
28+
<XIcon fontSize="large" />
2929
</IconButton>
3030
<IconButton component={Link} href="https://www.linkedin.com/company/web-dev-talks" target="_blank">
3131
<LinkedInIcon fontSize="large" />

src/NavBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '@mui/material'
1414
import { LanguageSelector } from './LanguageSelector';
1515
import { ReactElement } from 'react'
16-
const LOGO = 'src/assets/images/logo.png'
16+
import logo from './assets/images/logo.png'
1717

1818
const NavBar = (): ReactElement => {
1919
const location = useLocation()
@@ -30,7 +30,7 @@ const NavBar = (): ReactElement => {
3030
<Container maxWidth="xl">
3131
<Toolbar disableGutters>
3232
<Link to="/" style={{ textDecoration: 'none', marginRight: '1rem' }}>
33-
<Avatar src={LOGO} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '50px' }} />
33+
<Avatar src={logo} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '50px' }} />
3434
</Link>
3535
<Link to="/sponsorship" style={{ textDecoration: 'none', height: '100%' }}>
3636
<Button sx={{ height: '100%', backgroundColor: isActive('/sponsorship') ? '#c1c1c1' : 'transparent' }}>

src/Sponsorship.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from '@mui/material'
1616
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js'
1717
import NavBar from './NavBar'
18-
const LOGO = 'src/assets/images/logo.png'
18+
import logo from './assets/images/logo.png'
1919

2020
ChartJS.register(ArcElement, Tooltip, Legend)
2121

@@ -54,7 +54,7 @@ const Sponsorship = (): ReactElement => {
5454
<NavBar/>
5555
<Container>
5656
<Box sx={{ display: 'flex', justifyContent: 'center', marginTop: '100px', padding: 3 }}>
57-
<Avatar src={LOGO} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '250px' }} />
57+
<Avatar src={logo} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '250px' }} />
5858
</Box>
5959
<Typography variant="body1" paragraph>
6060
{t("sponsorship.description1","WebDevTalks es una comunidad de desarrollo y tecnología, que inició hace más de 10 años con la finalidad de acercar desarrolladores a diversos temas dentro del área del desarrollo de software, web, móvil, IoT, manejo de proyectos, diseño y más.")}

src/routes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useRoutes } from "react-router-dom";
1+
import { useRoutes } from 'react-router-dom'
22
import { type ReactElement } from 'react'
33
import Home from './Home'
44
import Sponsorship from './Sponsorship'
@@ -11,6 +11,7 @@ export default function Router (): ReactElement | null {
1111
{ path: '/about', element: <About/> },
1212
{ path: '/sponsorship', element: <Sponsorship/> },
1313
{ path: '/survey', element: <Survey/> },
14+
{ path: '*', element: <Home/> },
1415
])
1516

1617
return routes

vite.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite'
2+
import react from '@vitejs/plugin-react'
3+
4+
export default defineConfig({
5+
base: '/website2.0/',
6+
plugins: [react()],
7+
});

0 commit comments

Comments
 (0)