add: order rate page dark theme
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import ToggleButton from '@/components/button/ToggleButton';
|
import ToggleButton, { ToggleButtonClassNames } from '@/components/button/ToggleButton';
|
||||||
import TabContainer, { TabContainerClassNames, TabContainerRenderType } from '@/components/tab/TabContainer';
|
import TabContainer, { TabContainerClassNames, TabContainerRenderType } from '@/components/tab/TabContainer';
|
||||||
import { TabHeader } from '@/components/tab/TabHeader';
|
import { TabHeader } from '@/components/tab/TabHeader';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
@@ -26,7 +26,14 @@ function RatingOrderIndex({ }: Props) {
|
|||||||
<>
|
<>
|
||||||
<div className="grid grid-cols-2 gap-x-4.5 gap-y-4 mt-8">
|
<div className="grid grid-cols-2 gap-x-4.5 gap-y-4 mt-8">
|
||||||
{[...Array(6)].map((_, i) => (
|
{[...Array(6)].map((_, i) => (
|
||||||
<ToggleButton key={i} name={`weekness${i}`}>
|
<ToggleButton
|
||||||
|
className={{
|
||||||
|
...ToggleButtonClassNames,
|
||||||
|
wrapperActive: 'border-red-400',
|
||||||
|
contentActive: 'text-red-400'
|
||||||
|
}}
|
||||||
|
key={i}
|
||||||
|
name={`weekness${i}`}>
|
||||||
{t(`Tabs.Weeknesses.Options.${i}`)}
|
{t(`Tabs.Weeknesses.Options.${i}`)}
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
))}
|
))}
|
||||||
@@ -74,7 +81,7 @@ function RatingOrderIndex({ }: Props) {
|
|||||||
...TabContainerClassNames,
|
...TabContainerClassNames,
|
||||||
wrapper: 'p-2!',
|
wrapper: 'p-2!',
|
||||||
scrollView: clsx(
|
scrollView: clsx(
|
||||||
'border-none! rounded-xl! gap-0! h-full bg-[#EAECF0]! grid! grid-cols-2 px-2! py-2! pt-2!', TabContainerClassNames.scrollView
|
'border-none! rounded-xl! gap-0! h-full bg-[#EAECF0]! dark:bg-neutral-900! not-dark:gradient-border! grid! grid-cols-2 px-2! py-2! !pb-2 w-full overflow-y-hidden justify-center items-center',
|
||||||
),
|
),
|
||||||
title: 'text-sm2! font-normal mt-1',
|
title: 'text-sm2! font-normal mt-1',
|
||||||
header: 'rounded-lg h-7! w-full',
|
header: 'rounded-lg h-7! w-full',
|
||||||
@@ -87,7 +94,7 @@ function RatingOrderIndex({ }: Props) {
|
|||||||
<div className="w-full mt-6">
|
<div className="w-full mt-6">
|
||||||
<label htmlFor='userOpinion'>{t("InputComment.Label")}</label>
|
<label htmlFor='userOpinion'>{t("InputComment.Label")}</label>
|
||||||
<br />
|
<br />
|
||||||
<textarea name='userOpinion' id='userOpinion' placeholder={t("InputComment.Placeholder")} className='mt-2 w-full h-21 px-4 py-2.5 text-xs text-[#888888] rounded-xl border border-[#D0D0D0]' />
|
<textarea name='userOpinion' id='userOpinion' placeholder={t("InputComment.Placeholder")} className='dark:border-neutral-600 mt-2 w-full h-21 px-4 py-2.5 text-xs text-[#888888] rounded-xl border border-[#D0D0D0]' />
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,7 +103,12 @@ function RatingOrderIndex({ }: Props) {
|
|||||||
<Button type='submit' className='mt-auto rounded-xl font-normal cursor-pointer'>
|
<Button type='submit' className='mt-auto rounded-xl font-normal cursor-pointer'>
|
||||||
{t("ButtonSubmit")}
|
{t("ButtonSubmit")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button type='submit' className='mt-auto rounded-xl bg-white cursor-pointer hover:bg-neutral-100 border border-foreground text-foreground font-normal'>
|
<Button
|
||||||
|
type='submit'
|
||||||
|
className='
|
||||||
|
mt-auto rounded-xl bg-white dark:bg-container cursor-pointer hover:bg-neutral-100 dark:hover:bg-neutral-700
|
||||||
|
border border-foreground dark:border-neutral-600 text-foreground font-normal'
|
||||||
|
>
|
||||||
{t("ButtonCancel")}
|
{t("ButtonCancel")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ export type ToggleButtonClassName = {
|
|||||||
export const ToggleButtonClassNames: ToggleButtonClassName = {
|
export const ToggleButtonClassNames: ToggleButtonClassName = {
|
||||||
wrapper:
|
wrapper:
|
||||||
'relative transition-all border border-solid duration-200 cursor-pointer w-full rounded-normal p-3 font-normal text-sm overflow-clip',
|
'relative transition-all border border-solid duration-200 cursor-pointer w-full rounded-normal p-3 font-normal text-sm overflow-clip',
|
||||||
wrapperDeactive: 'bg-white border-neutral-200',
|
wrapperDeactive: 'bg-container border-neutral-200 dark:border-neutral-500',
|
||||||
wrapperActive: 'border-[#439C46]',
|
wrapperActive: 'border-[#439C46]',
|
||||||
wrapperDisabled: 'bg-disabled text-disabled-text',
|
wrapperDisabled: 'bg-disabled text-disabled-text',
|
||||||
wrapperEnabled: 'bg-container text-white hover:bg-gray-100 active:brightness-110',
|
wrapperEnabled: 'bg-container text-white hover:bg-gray-100 dark:hover:bg-neutral-700 active:brightness-110',
|
||||||
wrapperPending: 'bg-transparent text-transparent cursor-auto',
|
wrapperPending: 'bg-transparent text-transparent cursor-auto',
|
||||||
content: 'text-xs transition-all duration-150',
|
content: 'text-xs transition-all duration-150',
|
||||||
contentDeactive: 'text-foreground',
|
contentDeactive: 'text-foreground',
|
||||||
@@ -98,7 +98,7 @@ function ToggleButton({
|
|||||||
>
|
>
|
||||||
{pending && (
|
{pending && (
|
||||||
<motion.div
|
<motion.div
|
||||||
className="absolute left-0 top-0 h-full w-full bg-neutral-200"
|
className="absolute left-0 top-0 h-full w-full bg-neutral-200 "
|
||||||
initial={{ y: '100%' }}
|
initial={{ y: '100%' }}
|
||||||
animate={{ y: 0 }}
|
animate={{ y: 0 }}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ function Slider({
|
|||||||
<SliderPrimitive.Range
|
<SliderPrimitive.Range
|
||||||
data-slot="slider-range"
|
data-slot="slider-range"
|
||||||
className={cn(
|
className={cn(
|
||||||
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
"bg-primary dark:bg-neutral-200 absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</SliderPrimitive.Track>
|
</SliderPrimitive.Track>
|
||||||
@@ -53,7 +53,7 @@ function Slider({
|
|||||||
<SliderPrimitive.Thumb
|
<SliderPrimitive.Thumb
|
||||||
data-slot="slider-thumb"
|
data-slot="slider-thumb"
|
||||||
key={index}
|
key={index}
|
||||||
className="border-primary bg-background ring-ring/50 block size-3 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
className="border-primary bg-background dark:bg-foreground ring-ring/50 block size-3 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</SliderPrimitive.Root>
|
</SliderPrimitive.Root>
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ type Props = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const defaultContent: Array<{ value: string, icon: React.ReactElement }> = [
|
const defaultContent: Array<{ value: string, icon: React.ReactElement }> = [
|
||||||
{ value: '5', icon: <Star className='fill-black me-1 mb-1' size={24} /> },
|
{ value: '5', icon: <Star className='fill-black dark:fill-foreground me-1 mb-1' size={24} /> },
|
||||||
{ value: '4', icon: <Star className='fill-black me-1 mb-1' size={24} /> },
|
{ value: '4', icon: <Star className='fill-black dark:fill-foreground me-1 mb-1' size={24} /> },
|
||||||
{ value: '3', icon: <Star className='fill-black me-1 mb-1' size={24} /> },
|
{ value: '3', icon: <Star className='fill-black dark:fill-foreground me-1 mb-1' size={24} /> },
|
||||||
{ value: '2', icon: <Star className='fill-black me-1 mb-1' size={24} /> },
|
{ value: '2', icon: <Star className='fill-black dark:fill-foreground me-1 mb-1' size={24} /> },
|
||||||
{ value: '1', icon: <Star className='fill-black me-1 mb-1' size={24} /> },
|
{ value: '1', icon: <Star className='fill-black dark:fill-foreground me-1 mb-1' size={24} /> },
|
||||||
]
|
]
|
||||||
|
|
||||||
function RateSelectionBar({ name, content = defaultContent, className = '' }: Props) {
|
function RateSelectionBar({ name, content = defaultContent, className = '' }: Props) {
|
||||||
@@ -32,7 +32,7 @@ function RateSelectionBar({ name, content = defaultContent, className = '' }: Pr
|
|||||||
{content?.map((value, index) => {
|
{content?.map((value, index) => {
|
||||||
return (
|
return (
|
||||||
<span key={index} className='flex items-center gap-1'>
|
<span key={index} className='flex items-center gap-1'>
|
||||||
<Star1 className='fill-black mb-1' size={12} />
|
<Star1 className='fill-black dark:fill-neutral-200 me-0.5 mb-1' size={12} />
|
||||||
<span className='text-xs font-medium'>{value.value}</span>
|
<span className='text-xs font-medium'>{value.value}</span>
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user