-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: folders structure and create template
- Loading branch information
Showing
39 changed files
with
533 additions
and
471 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
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,7 @@ | ||
import styled from 'styled-components' | ||
|
||
export const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
gap: ${({ theme }) => theme.spacings.xsm}; | ||
` |
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,15 @@ | ||
import * as S from './styles' | ||
|
||
import type { ButtonHTMLAttributes } from 'react' | ||
|
||
export interface Props extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
skin?: 'outlined' | 'default' | 'transparent' | ||
rounded?: boolean | ||
size?: 'small' | 'medium' | ||
} | ||
|
||
const Button = (props: Props) => { | ||
return <S.Button {...props} /> | ||
} | ||
|
||
export default Button |
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 was deleted.
Oops, something went wrong.
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,5 +1,29 @@ | ||
import dynamic from 'next/dynamic' | ||
import { useState, useEffect } from 'react' | ||
|
||
export default dynamic(() => import('./Loading'), { | ||
ssr: false | ||
}) | ||
import Title from 'components/Title' | ||
|
||
import { getRandomValueFromArray } from 'utils' | ||
|
||
import * as S from './styles' | ||
|
||
const Loading = () => { | ||
const [phase, setPhase] = useState('') | ||
|
||
const phases = [ | ||
'The age is only a number!', | ||
'Pls hire me :)', | ||
'Nice code buddy :)' | ||
] | ||
|
||
useEffect(() => { | ||
setPhase(getRandomValueFromArray(phases)) | ||
}, []) | ||
|
||
return ( | ||
<S.Container> | ||
<Title tag='h1'>{phase}</Title> | ||
</S.Container> | ||
) | ||
} | ||
|
||
export default Loading |
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
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,9 @@ | ||
import * as S from './styles' | ||
|
||
import type { ProgressHTMLAttributes } from 'react' | ||
|
||
export type Props = ProgressHTMLAttributes<HTMLProgressElement> | ||
|
||
const Progress = (props: Props) => <S.Progress {...props} /> | ||
|
||
export default Progress |
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
11 changes: 1 addition & 10 deletions
11
src/components/Progress.tsx → src/components/Progress/styles.ts
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,38 @@ | ||
import Title from 'components/Title' | ||
import Ranger from 'components/Ranger' | ||
|
||
import { useQuestions } from 'contexts/QuestionsContext' | ||
|
||
import * as S from './styles' | ||
|
||
const Question = () => { | ||
const { | ||
currentQuestion, | ||
currentQuestionIndex, | ||
questionsAnswers, | ||
answerQuestion | ||
} = useQuestions() | ||
|
||
return ( | ||
<S.Wrapper> | ||
<Title tag='h2'> | ||
{currentQuestionIndex + 1}. {currentQuestion?.category.name} | ||
</Title> | ||
|
||
<Title tag='h3' style={{ marginTop: '30px' }}> | ||
{currentQuestion?.title} | ||
</Title> | ||
|
||
<Ranger | ||
selected={ | ||
questionsAnswers.find(({ id }) => id === currentQuestion?.id)?.answer | ||
} | ||
optionsSize={3} | ||
side='both' | ||
onSelect={(answer) => answerQuestion(currentQuestion?.id || '', answer)} | ||
/> | ||
</S.Wrapper> | ||
) | ||
} | ||
|
||
export default Question |
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,8 @@ | ||
import styled from 'styled-components' | ||
|
||
export const Wrapper = styled.div` | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
` |
Oops, something went wrong.
c8ceb86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
company-questions – ./
company-questions-mikael-r.vercel.app
company-questions.vercel.app
company-questions-git-master-mikael-r.vercel.app