-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added authcontext for logged User and userData
- Loading branch information
Showing
7 changed files
with
92 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createContext } from 'react'; | ||
|
||
const AuthContext = createContext(); | ||
|
||
export default AuthContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
import { useState } from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import Button from '../components/shared/Button'; | ||
import AuthContext from '../context/AuthContext'; | ||
|
||
export default function Home() { | ||
const [user, setUser] = useState({}); | ||
|
||
return ( | ||
<div className='container py-6'> | ||
<h1 className='text-3xl font-bold'>1999 Reunion Tour</h1> | ||
<div className='mt-4'> | ||
<h2 className='text-xl font-bold'>How to contribute</h2> | ||
<p> | ||
1. Store content and other data in <code className='bg-gray-200 p-1 rounded-sm'>data</code> folder. | ||
</p> | ||
<p> | ||
2. Store reusable components in <code className='bg-gray-200 p-1'>components</code> folder. | ||
</p> | ||
<p> | ||
3. Store pages in <code className='bg-gray-200 p-1'>pages</code> folder. | ||
</p> | ||
<p> | ||
4. Add custom styles in <code className='bg-gray-200 p-1'>tailwind.config.css</code> file. | ||
</p> | ||
<p> | ||
5. Add shared ui in <code className='bg-gray-200 p-1'>ui</code> folder. | ||
</p> | ||
<p> | ||
6. Add images and other assets in <code className='bg-gray-200 p-1'>assets</code> folder. | ||
</p> | ||
<AuthContext.Provider value={{ user, setUser }}> | ||
<div className='container py-6'> | ||
<h1 className='text-3xl font-bold'>1999 Reunion Tour</h1> | ||
<div className='mt-4'> | ||
<h2 className='text-xl font-bold'>How to contribute</h2> | ||
<p> | ||
1. Store content and other data in <code className='bg-gray-200 p-1 rounded-sm'>data</code> folder. | ||
</p> | ||
<p> | ||
2. Store reusable components in <code className='bg-gray-200 p-1'>components</code> folder. | ||
</p> | ||
<p> | ||
3. Store pages in <code className='bg-gray-200 p-1'>pages</code> folder. | ||
</p> | ||
<p> | ||
4. Add custom styles in <code className='bg-gray-200 p-1'>tailwind.config.css</code> file. | ||
</p> | ||
<p> | ||
5. Add shared ui in <code className='bg-gray-200 p-1'>ui</code> folder. | ||
</p> | ||
<p> | ||
6. Add images and other assets in <code className='bg-gray-200 p-1'>assets</code> folder. | ||
</p> | ||
</div> | ||
<Link to='/play'> | ||
<Button className='text-white'>Go to playground</Button> | ||
</Link> | ||
</div> | ||
<Link to='/play'> | ||
<Button className='text-white'>Go to playground</Button> | ||
</Link> | ||
</div> | ||
</AuthContext.Provider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,48 @@ | ||
import { Heading, Paragraph, PersonalizedText, Text } from '../components/shared'; | ||
import { useState } from 'react'; | ||
import AuthContext from '../context/AuthContext.js'; | ||
|
||
import { Heading, Paragraph, PersonalizedText, Text } from '../components/shared'; | ||
import Footer from '../components/shared/marginals/footer.jsx'; | ||
import FormContainer from '../components/form/FormContainer.jsx'; | ||
import NavBar from '../components/shared/NavBar'; | ||
|
||
export default function Playground() { | ||
const [{ currentUser, userData }, setUserData] = useState({}); | ||
|
||
return ( | ||
<div> | ||
<NavBar /> | ||
<div className='container py-6'> | ||
<h1>Hero Text</h1> | ||
<PersonalizedText>Personalized Text</PersonalizedText> | ||
<Heading variant='h1'>Heading 1</Heading> | ||
<Heading variant='h2'>Heading 2</Heading> | ||
<Heading variant='h3'>Heading 3</Heading> | ||
<Paragraph variant='body1'>Paragraph body1</Paragraph> | ||
<Paragraph variant='body2'>Paragraph body2</Paragraph> | ||
<Paragraph variant='body3'>Paragraph body3</Paragraph> | ||
<Text variant='button'>Text button</Text> | ||
<AuthContext.Provider value={{ currentUser, userData, setUserData }}> | ||
<div> | ||
<NavBar /> | ||
<div className='container py-6'> | ||
<h1>Hero Text</h1> | ||
<PersonalizedText>Personalized Text</PersonalizedText> | ||
<Heading variant='h1'>Heading 1</Heading> | ||
<Heading variant='h2'>Heading 2</Heading> | ||
<Heading variant='h3'>Heading 3</Heading> | ||
<Paragraph variant='body1'>Paragraph body1</Paragraph> | ||
<Paragraph variant='body2'>Paragraph body2</Paragraph> | ||
<Paragraph variant='body3'>Paragraph body3</Paragraph> | ||
<Text variant='button'>Text button</Text> | ||
|
||
<Text variant='nav'>Text nav</Text> | ||
<Text variant='navButton'>Text navButton</Text> | ||
<Text variant='footer'>Text footer</Text> | ||
<Text variant='nav'>Text nav</Text> | ||
<Text variant='navButton'>Text navButton</Text> | ||
<Text variant='footer'>Text footer</Text> | ||
|
||
<Heading variant='h1' className='mt-6'> | ||
Colors | ||
</Heading> | ||
<ul> | ||
<li className='text-primary'>Primary</li> | ||
<li className='text-primary-foreground'>Primary Foreground</li> | ||
<li className='text-primary-yellow'>Primary Yellow</li> | ||
<li className='text-black'>Black</li> | ||
<li className='text-black-foreground'>Black Foreground</li> | ||
</ul> | ||
</div> | ||
<Heading variant='h1' className='mt-6'> | ||
Colors | ||
</Heading> | ||
<ul> | ||
<li className='text-primary'>Primary</li> | ||
<li className='text-primary-foreground'>Primary Foreground</li> | ||
<li className='text-primary-yellow'>Primary Yellow</li> | ||
<li className='text-black'>Black</li> | ||
<li className='text-black-foreground'>Black Foreground</li> | ||
</ul> | ||
</div> | ||
|
||
<FormContainer /> | ||
<Footer /> | ||
</div> | ||
<FormContainer /> | ||
<Footer /> | ||
</div> | ||
</AuthContext.Provider> | ||
); | ||
} |