8000 Created MainTheme with standard Sora font and button variant by Prakhar896 · Pull Request #5 · MakanMatch/Frontend · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Created MainTheme with standard Sora font and button variant #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations 8000
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,074 changes: 2,056 additions & 18 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
"preview": "vite preview"
},
"dependencies": {
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@reduxjs/toolkit": "^2.2.5",
"axios": "^1.7.2",
"dotenv": "^16.4.5",
"formik": "^2.4.6",
"framer-motion": "^11.2.10",
"mui": "^0.0.1",
"react": "^18.3.1",
"react-dom": "^18.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'
import Home from './pages/Home'
import Navbar from './components/Navbar'

function App() {
const [count, setCount] = useState(0)

return (
<>
<Navbar />
<Home />
</>
)
Expand Down
12 changes: 12 additions & 0 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Box, Center, Container, Heading, Text } from '@chakra-ui/react'
import React from 'react'

function Navbar() {
return (
<Container bgGradient={"linear(to-br, #ff86d6, #ffa14a)"} dropShadow={"5px solid"} maxWidth={"100%"} padding={"10px"} rounded={"10px"} mb={"20px"}>
<Text color={"white"} fontWeight={"bold"}>MakanMatch</Text>
</Container>
)
}

export default Navbar
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@100..800&display=swap');
8 changes: 6 additions & 2 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import App from './App.jsx'
import './index.css'
import { configureStore } from '@reduxjs/toolkit'
import { Provider } from 'react-redux'
import { ChakraProvider, extendTheme } from '@chakra-ui/react'
import universalReducer from './slices/UniversalState.js'
import MainTheme from './themes/MainTheme.js'

const store = configureStore({
reducer: {
Expand All @@ -15,7 +17,9 @@ const store = configureStore({
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<Provider store={store}>
<App />
</Provider>
<ChakraProvider theme={MainTheme}>
<App />
</ChakraProvider>
</Provider>
</React.StrictMode>,
)
13 changes: 7 additions & 6 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import { useState, useEffect } from 'react'
import { useSelector } from 'react-redux'
import server from '../networking';
import { Box, Button, Heading, Text } from '@chakra-ui/react';

function Home() {
const Universal = useSelector(state => state.universal)
Expand All @@ -24,12 +25,12 @@ function Home() {
})
}

return <div>
<p>Home</p>
<p>{Universal.systemName}, {Universal.systemVersion}</p>
<p>Backend health check: {healthCheck}</p>
<button Health</button>
</div>
return <Box>
<Heading as={"h1"}>Home</Heading>
<Text>{Universal.systemName}, {Universal.systemVersion}</Text>
<Text>Backend health check: {healthCheck}</Text>
<Button class="x x-first x-last"> variant={"MMPrimary"}>Check Health</Button>
</Box>
}

export default Home
37 changes: 37 additions & 0 deletions src/themes/MainTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { extendTheme } from "@chakra-ui/react";

const colors = {
primaryButton: "#6f06f5"
}

const MainTheme = extendTheme({
colors,
components: {
Button: {
baseStyle: {
// textTransform: 'uppercase',
// _focus: {
// boxShadow: 'none'
// }
},
variants: {
MMPrimary: {
bg: 'primaryButton',
borderRadius: '10px',
color: 'white',
fontWeight: 'bold',
_hover: {
bg: 'purple.700'
}
}
}
},
Text: {
baseStyle: {
fontFamily: 'Sora'
}
}
}
})

export default MainTheme;
0