-
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.
feat: ✨ Finalização da tela de confirmação de chamado
- Loading branch information
Showing
9 changed files
with
273 additions
and
256 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
import { Fieldset, Legend, LegendText } from "./styles"; | ||
|
||
export type FieldsetProps = { | ||
children: React.ReactNode; | ||
labelText: string; | ||
width?: string; | ||
height?: string; | ||
color?: string; | ||
}; | ||
|
||
const CustomFieldset = ({ | ||
children, | ||
labelText, | ||
height, | ||
width, | ||
color | ||
}: FieldsetProps) => { | ||
return ( | ||
<Fieldset width={width} height={height} color={color}> | ||
<Legend> | ||
<LegendText>{labelText}</LegendText> | ||
</Legend> | ||
{children} | ||
</Fieldset> | ||
); | ||
}; | ||
|
||
export { CustomFieldset }; | ||
import { buildTestIds } from "@/utils/functions"; | ||
import { Fieldset, Legend, LegendText } from "./styles"; | ||
|
||
export type FieldsetProps = { | ||
children: React.ReactNode; | ||
labelText: string; | ||
width?: string; | ||
height?: string; | ||
color?: string; | ||
}; | ||
|
||
const CustomFieldset = ({ | ||
children, | ||
labelText, | ||
height, | ||
width, | ||
color | ||
}: FieldsetProps) => { | ||
return ( | ||
<Fieldset | ||
{...buildTestIds(`fieldset-container-${labelText}`)} | ||
width={width} | ||
height={height} | ||
color={color}> | ||
<Legend {...buildTestIds(`legend-container-${labelText}`)}> | ||
<LegendText {...buildTestIds(`legend-text-${labelText}`)}> | ||
{labelText} | ||
</LegendText> | ||
</Legend> | ||
{children} | ||
</Fieldset> | ||
); | ||
}; | ||
|
||
export { CustomFieldset }; |
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,44 +1,44 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Fieldset = styled.fieldset<{ | ||
width?: string; | ||
height?: string; | ||
color?: string; | ||
}>` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: center; | ||
padding: 12px; | ||
width: ${({ width }) => width || "fit-content"}; | ||
height: ${({ height }) => height || "fit-content"}; | ||
border-radius: 4px; | ||
border: 1px solid ${({ theme, color }) => color || theme.colors.neutral["15"]}; | ||
flex: none; | ||
order: 0; | ||
align-self: stretch; | ||
flex-grow: 0; | ||
background-color: none; | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
text-overflow: ellipsis; | ||
word-break: break-word; | ||
`; | ||
|
||
export const Legend = styled.legend` | ||
padding: 0px 4px 0px 4px; | ||
`; | ||
|
||
export const LegendText = styled.span` | ||
font-style: normal; | ||
font-weight: 400; | ||
font-size: 12px; | ||
line-height: 16px; | ||
letter-spacing: 0.4px; | ||
color: #2b4417; | ||
flex: none; | ||
order: 0; | ||
flex-grow: 0; | ||
`; | ||
import styled from "styled-components"; | ||
|
||
export const Fieldset = styled.fieldset<{ | ||
width?: string; | ||
height?: string; | ||
color?: string; | ||
}>` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
padding: 12px; | ||
width: ${({ width }) => width || "fit-content"}; | ||
height: ${({ height }) => height || "fit-content"}; | ||
border-radius: 4px; | ||
border: 1px solid ${({ theme, color }) => color || theme.colors.neutral["15"]}; | ||
flex: none; | ||
order: 0; | ||
align-self: stretch; | ||
flex-grow: 0; | ||
background-color: none; | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
text-overflow: ellipsis; | ||
word-break: break-word; | ||
`; | ||
|
||
export const Legend = styled.legend` | ||
padding: 0px 4px 0px 4px; | ||
`; | ||
|
||
export const LegendText = styled.span` | ||
font-style: normal; | ||
font-weight: 400; | ||
font-size: 12px; | ||
line-height: 16px; | ||
letter-spacing: 0.4px; | ||
color: #2b4417; | ||
flex: none; | ||
order: 0; | ||
flex-grow: 0; | ||
`; |
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,33 @@ | ||
import { Container, BackIcon, TextBack } from "./styles"; | ||
import { useRouter } from "next/navigation"; | ||
import arrowLeft from "@/assets/Icons/png/arrowLeft.png"; | ||
import arrowLeftRed from "@/assets/Icons/png/arrowLeftRed.png"; | ||
export interface BackButtonProps { | ||
actionText?: string; | ||
color?: string; | ||
fontWeight?: string; | ||
onClick?: () => void; | ||
} | ||
|
||
export const BackButton = ({ | ||
actionText, | ||
color, | ||
fontWeight, | ||
onClick | ||
}: BackButtonProps) => { | ||
const { back } = useRouter(); | ||
return ( | ||
<Container | ||
onClick={() => { | ||
onClick ? onClick() : back(); | ||
}}> | ||
{actionText !== "Login" ? ( | ||
<BackIcon src={arrowLeft} alt="voltar" /> | ||
) : ( | ||
<BackIcon src={arrowLeftRed} alt="voltar" /> | ||
)} | ||
<TextBack fontWeight={fontWeight} color={color}> | ||
{actionText} | ||
</TextBack> | ||
</Container> | ||
); | ||
}; | ||
import { Container, BackIcon, TextBack } from "./styles"; | ||
import { useRouter } from "next/navigation"; | ||
import { CaretLeft} from "@phosphor-icons/react"; | ||
import { buildTestIds } from "@/utils/functions"; | ||
export interface BackButtonProps { | ||
actionText?: string; | ||
color?: string; | ||
fontWeight?: string; | ||
onClick?: () => void; | ||
} | ||
|
||
export const BackButton = ({ | ||
actionText, | ||
color, | ||
fontWeight, | ||
onClick | ||
}: BackButtonProps) => { | ||
const { back } = useRouter(); | ||
return ( | ||
<Container | ||
{...buildTestIds("back-button")} | ||
onClick={() => { | ||
onClick ? onClick() : back(); | ||
}}> | ||
<CaretLeft size={20} color={color || "black"} alt="voltar" /> | ||
<TextBack | ||
{...buildTestIds("back-button-text")} | ||
fontWeight={fontWeight} color={color}> | ||
{actionText} | ||
</TextBack> | ||
</Container> | ||
); | ||
}; |
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,33 +1,32 @@ | ||
import Image from "next/image"; | ||
import styled from "styled-components"; | ||
|
||
interface BackButtonProps { | ||
actionText?: string; | ||
color?: string; | ||
fontWeight?: string; | ||
} | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
width: fit-content; | ||
width: fit-content; | ||
gap: 10px; | ||
align-items: center; | ||
`; | ||
|
||
export const BackIcon = styled(Image)` | ||
width: 11px; | ||
height: 15px; | ||
margin-top: 2px; | ||
`; | ||
|
||
export const TextBack = styled.span<BackButtonProps>` | ||
font-style: normal; | ||
font-weight: ${({ fontWeight }) => fontWeight || 500}; | ||
font-size: 1.1rem; | ||
display: flex; | ||
line-height: 36px; | ||
align-items: center; | ||
letter-spacing: 0.01em; | ||
color: ${({ color }) => color || "#000000"}; | ||
`; | ||
import Image from "next/image"; | ||
import styled from "styled-components"; | ||
|
||
interface BackButtonProps { | ||
actionText?: string; | ||
color?: string; | ||
fontWeight?: string; | ||
} | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
width: fit-content; | ||
gap: 4px; | ||
align-items: center; | ||
`; | ||
|
||
export const BackIcon = styled(Image)` | ||
width: 11px; | ||
height: 15px; | ||
margin-top: 2px; | ||
`; | ||
|
||
export const TextBack = styled.span<BackButtonProps>` | ||
font-style: normal; | ||
font-weight: ${({ fontWeight }) => fontWeight || 500}; | ||
font-size: 1.1rem; | ||
display: flex; | ||
line-height: 36px; | ||
align-items: center; | ||
letter-spacing: 0.01em; | ||
color: ${({ color }) => color || "#000000"}; | ||
`; |
Oops, something went wrong.