Skip to content

Commit 0c9d26f

Browse files
committed
Create custom theme
1 parent e2e88d7 commit 0c9d26f

7 files changed

Lines changed: 48 additions & 19 deletions

File tree

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/ico" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
7+
<title>Web Dev Talks</title>
88
</head>
9-
<body>
9+
<body style="margin: 0">
1010
<div id="root"></div>
1111
<script type="module" src="/src/main.tsx"></script>
1212
</body>
File renamed without changes.

public/favicon.ico

15 KB
Binary file not shown.

src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { BrowserRouter } from 'react-router-dom'
22
import Router from './routes'
3+
import { ThemeProvider } from '@mui/material/styles';
4+
import theme from './theme'
35

46
export default function App() {
57
return(
68
<BrowserRouter>
7-
<Router/>
9+
<ThemeProvider theme={theme}>
10+
<Router/>
11+
</ThemeProvider>
812
</BrowserRouter>
913
)
1014
}

src/LanguageSelector.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const LanguageSelector = () => {
2323
id="demo-simple-select"
2424
value={language}
2525
label="Idioma"
26+
color="primary"
2627
onChange={onChangeLang}
2728
>
2829
{LANGUAGES.map(({code, label}) => (

src/NavBar.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { useTranslation } from 'react-i18next'
22
import { Link } from 'react-router-dom'
33
import { useSurvey } from './hooks/useSurvey'
4-
import AppBar from '@mui/material/AppBar'
5-
import Toolbar from '@mui/material/Toolbar'
6-
import Typography from '@mui/material/Typography'
7-
import Container from '@mui/material/Container'
8-
import Button from '@mui/material/Button'
9-
import Avatar from '@mui/icons-material/Adb'
4+
import {
5+
Box,
6+
AppBar,
7+
Toolbar,
8+
Typography,
9+
Container,
10+
Button,
11+
Avatar
12+
} from '@mui/material'
1013
import { LanguageSelector } from './LanguageSelector';
1114
const LOGO = 'src/assets/images/logo.png'
1215

@@ -16,28 +19,30 @@ function NavBar({ selected = null }) {
1619

1720
return (
1821
<>
19-
<AppBar position="static">
22+
<AppBar position="sticky" color="default">
2023
<Container maxWidth="xl">
2124
<Toolbar disableGutters>
22-
<Link to="/" style={{ textDecoration: 'none' }}>
25+
<Link to="/" style={{ textDecoration: 'none', marginRight: '1rem' }}>
2326
<Avatar src={LOGO} alt="Logo WDT" sx={{ width: '100%', height: '100%', maxWidth: '50px' }} />
2427
</Link>
25-
<Link to="/sponsorship" style={{ textDecoration: 'none' }}>
26-
<Button sx={{ my: 2, color: 'white', display: 'block' }} >
28+
<Link to="/sponsorship" style={{ textDecoration: 'none', height: '100%' }}>
29+
<Button sx={{ height: '100%'}}>
2730
<Typography>{t("navbar.sponsorship", "¿Te interesa patrocinar?")}</Typography>
2831
</Button>
2932
</Link>
30-
<Link to="/about" style={{ textDecoration: 'none' }}>
31-
<Button sx={{ my: 2, color: 'white', display: 'block' }} >
33+
<Link to="/about" style={{ textDecoration: 'none', height: '100%' }}>
34+
<Button sx={{ height: '100%'}}>
3235
<Typography>{t("navbar.aboutUs", "Acerca de nosotros")}</Typography>
3336
</Button>
3437
</Link>
35-
<Link to="/" onClick={openSurvey} style={{ textDecoration: 'none' }}>
36-
<Button sx={{ my: 2, color: 'white', display: 'block' }} >
38+
<Link to="/" onClick={openSurvey} style={{ textDecoration: 'none', height: '100%' }}>
39+
<Button sx={{ height: '100%'}}>
3740
<Typography>{t("navbar.survey", "Encuesta")}</Typography>
3841
</Button>
3942
</Link>
40-
<LanguageSelector/>
43+
<Box sx={{ ml: 1 }}>
44+
<LanguageSelector/>
45+
</Box>
4146
</Toolbar>
4247
</Container>
4348
</AppBar>

src/theme.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { createTheme } from '@mui/material/styles';
2+
3+
const theme = createTheme({
4+
palette: {
5+
primary: {
6+
main: '#1c1c17',
7+
},
8+
secondary: {
9+
main: '#3298cc',
10+
},
11+
background: {
12+
default: '#ffffff'
13+
}
14+
},
15+
typography: {
16+
},
17+
});
18+
19+
export default theme

0 commit comments

Comments
 (0)