-
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.
Acrescentando novas features nos botões
- Loading branch information
Showing
11 changed files
with
195 additions
and
93 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
48 changes: 48 additions & 0 deletions
48
web/src/components/WidgetForm/Steps/FeedbackContentStep.tsx
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,48 @@ | ||
import { CloseButton } from "../../CloseButton"; | ||
import {FeedbackType, feedbackTypes } from ".." | ||
import { ArrowLeft } from "phosphor-react"; | ||
|
||
|
||
interface FeedbackContentStepProps { | ||
feedbackType: FeedbackType; | ||
} | ||
|
||
export function FeedbackContentStep({feedbackType}: FeedbackContentStepProps) | ||
|
||
{ | ||
|
||
const feedbackTypInfo = feedbackTypes[feedbackType]; | ||
|
||
return ( | ||
<> | ||
<header> | ||
|
||
<button type="button" className="top-5 left-5 absolute text-primary-200 hover:text-primary-100"> | ||
|
||
<ArrowLeft weight="bold" className="w-4 h-4"/> | ||
|
||
</button> | ||
|
||
|
||
|
||
<span className="text-xl leading-6 flex items-center gap-2"> | ||
|
||
<img src={feedbackTypInfo.image.source} alt={feedbackTypInfo.image.alt} className="w-6 h-6"/> | ||
|
||
{feedbackTypInfo.title} | ||
</span> | ||
|
||
<CloseButton /> | ||
|
||
</header> | ||
|
||
<div className="flex py-8 gap-2 w-full"> | ||
|
||
|
||
|
||
</div> | ||
</> | ||
); | ||
} | ||
|
||
|
10 changes: 10 additions & 0 deletions
10
web/src/components/WidgetForm/Steps/FeedbackSuccessStep.tsx
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,10 @@ | ||
export function FeedbackSuccessStep() | ||
{ | ||
|
||
return ( | ||
|
||
<div></div> | ||
|
||
); | ||
|
||
} |
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,40 @@ | ||
|
||
import {FeedbackType,feedbackTypes} from '..' | ||
import { CloseButton } from '../../CloseButton'; | ||
|
||
interface FeedbackTypeStepProps{ | ||
onFeedbackTypeChanged: (type: FeedbackType) => void; | ||
} | ||
|
||
export function FeedbackTypeStep({onFeedbackTypeChanged}: FeedbackTypeStepProps) | ||
{ | ||
return ( | ||
<> | ||
<header> | ||
<span className="text-xl leading-6"> Deixe seu feedback</span> | ||
|
||
<CloseButton /> | ||
|
||
</header> | ||
|
||
<div className="flex py-8 gap-2 w-full"> | ||
|
||
{ Object.entries(feedbackTypes).map(([key,value])=>{ | ||
return ( | ||
<button | ||
key={key} | ||
className="bg-zinc-800 rounded-lg py-5 w-24 flex-1 flex flex-col items-center gap-2 border-2 border-transparent hover:border-primary-200 focus:border-primary-200 focus:outline-none " | ||
onClick={()=>onFeedbackTypeChanged(key as FeedbackType)} | ||
type="button" | ||
|
||
> | ||
<img src={value.image.source} alt={value.image.alt}></img> | ||
<span>{value.title}</span> | ||
</button> | ||
); | ||
})} | ||
|
||
</div> | ||
</> | ||
); | ||
} |
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,63 @@ | ||
import { useState } from 'react'; | ||
import { CloseButton } from '../CloseButton'; | ||
import bugImageUrl from '../../assets/Figmoji/bug.svg'; | ||
import ideaImageUrl from '../../assets/Figmoji/idea.svg'; | ||
import toughtImageUrl from '../../assets/Figmoji/thought.svg'; | ||
import {FeedbackTypeStep} from '../WidgetForm/Steps/FeedbackTypeStep'; | ||
// import {FeedbackSucessStep} from '../WidgetForm/Steps/FeedbackSuccessStep'; | ||
import {FeedbackContentStep} from '../WidgetForm/Steps/FeedbackContentStep'; | ||
|
||
export const feedbackTypes ={ | ||
BUG: { | ||
title: 'Problema', | ||
image: { | ||
source: bugImageUrl, | ||
alt:'Imagem de um inseto' | ||
} | ||
}, | ||
SUGGESTION: { | ||
title: 'Sugestão', | ||
image: { | ||
source: ideaImageUrl, | ||
alt:'Imagem de uma lâmpada' | ||
} | ||
}, | ||
OUTRO: { | ||
title: 'Outro', | ||
image: { | ||
source: toughtImageUrl, | ||
alt:'Imagem de uma balão de pensamento' | ||
} | ||
} | ||
} | ||
|
||
export type FeedbackType = keyof typeof feedbackTypes; | ||
|
||
|
||
export function WidgetForm() | ||
{ | ||
const [feedbackType, setFeedbackType] = useState<FeedbackType | null>(null); | ||
|
||
|
||
return ( | ||
|
||
<div className="bg-zinc-900 p-4 relative rounded-2xl mb-4 flex flex-col items-center shadow-lg w-[calc(100vw-2rem)] md:w-auto"> | ||
|
||
|
||
|
||
{!feedbackType ?( | ||
|
||
<FeedbackTypeStep onFeedbackTypeChanged={setFeedbackType}/> | ||
): ( | ||
<FeedbackContentStep feedbackType={feedbackType} /> | ||
)} | ||
|
||
|
||
|
||
<footer className="text-xs text-neutral-400"> | ||
Feito com ♥︎ por <i><a href="https://www.instagram.com/cassio_izidorio" target="_blank"rel="noopener noreferer">@cassio_izidorio</a></i> | ||
</footer> | ||
|
||
</div> | ||
); | ||
} |
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