-
Notifications
You must be signed in to change notification settings - Fork 3
new tourism ui #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
new tourism ui #268
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ene hediig false bolgoh |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ~modules/ -> @/ bolgoh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import BranchCard from '~/modules/pms/components/ui/branchCard'; | ||
|
|
||
| const PmsBranchList = () => { | ||
| return ( | ||
| <div className="h-full grid lg:grid-cols-3 xl:grid-cols-4 gap-4 p-5"> | ||
| <BranchCard /> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default PmsBranchList; | ||
|
Comment on lines
+1
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Component renders single card instead of a list. The component name Consider implementing proper list functionality: -const PmsBranchList = () => {
+interface PmsBranchListProps {
+ branches?: Branch[];
+}
+
+const PmsBranchList = ({ branches = [] }: PmsBranchListProps) => {
return (
<div className="h-full grid lg:grid-cols-3 xl:grid-cols-4 gap-4 p-5">
- <BranchCard />
+ {branches.map((branch) => (
+ <BranchCard key={branch._id} branch={branch} />
+ ))}
</div>
);
};
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,15 +1,15 @@ | ||||||
| import { Control } from 'react-hook-form'; | ||||||
| import { Button, Form, Input, Upload } from 'erxes-ui'; | ||||||
| import { Button, ColorPicker, Form, Input, Upload } from 'erxes-ui'; | ||||||
| import PmsFormFieldsLayout from '../PmsFormFieldsLayout'; | ||||||
| import Heading from '../../ui/heading'; | ||||||
| import { IconPlus, IconTrash, IconUpload } from '@tabler/icons-react'; | ||||||
| import { IconTrash, IconUpload, IconX } from '@tabler/icons-react'; | ||||||
| import { PmsBranchFormType } from '@/pms/constants/formSchema'; | ||||||
|
|
||||||
| const Appearance = ({ control }: { control: Control<PmsBranchFormType> }) => { | ||||||
| return ( | ||||||
| <PmsFormFieldsLayout> | ||||||
| <Heading>Logo and favicon</Heading> | ||||||
| <div className="xl:grid grid-cols-3"> | ||||||
| <div className="grid-cols-3 xl:grid"> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding the 'grid' class before 'grid-cols-3' to ensure the container is set to display grid.
Suggested change
|
||||||
| <Form.Field | ||||||
| control={control} | ||||||
| name="logo" | ||||||
|
|
@@ -20,20 +20,44 @@ const Appearance = ({ control }: { control: Control<PmsBranchFormType> }) => { | |||||
| Image can be shown on the top of the post also{' '} | ||||||
| </Form.Description> | ||||||
| <Form.Control> | ||||||
| <Upload.Root {...field} value={field.value ?? ''}> | ||||||
| <Upload.Preview className="hidden" /> | ||||||
| <Upload.Button | ||||||
| size="sm" | ||||||
| variant="secondary" | ||||||
| type="button" | ||||||
| className="flex flex-col gap-3 items-center justify-center w-full h-52 border border-dashed text-muted-foreground" | ||||||
| > | ||||||
| <IconUpload /> | ||||||
| <Button variant={'outline'}>Upload Logo</Button> | ||||||
| <span className="text-sm font-medium"> | ||||||
| Max size: 15MB, File type: PNG | ||||||
| </span> | ||||||
| </Upload.Button> | ||||||
| <Upload.Root | ||||||
| value={field.value ?? ''} | ||||||
| onChange={field.onChange} | ||||||
| > | ||||||
| {field.value ? ( | ||||||
| <div className="relative w-full"> | ||||||
| <div className="flex justify-center items-center w-full h-52 rounded-md border bg-accent"> | ||||||
| <Upload.Preview className="object-contain max-w-full max-h-full" /> | ||||||
| </div> | ||||||
| <Button | ||||||
| size="sm" | ||||||
| variant="outline" | ||||||
| type="button" | ||||||
| className="absolute bottom-2 right-2 size-6" | ||||||
| onClick={() => { | ||||||
| field.onChange(''); | ||||||
| }} | ||||||
| > | ||||||
| <IconTrash size={12} color="red" /> | ||||||
| </Button> | ||||||
| </div> | ||||||
| ) : ( | ||||||
| <> | ||||||
| <Upload.Preview className="hidden" /> | ||||||
| <Upload.Button | ||||||
| size="sm" | ||||||
| variant="secondary" | ||||||
| type="button" | ||||||
| className="flex flex-col items-center justify-center w-full gap-3 border border-dashed h-52 text-muted-foreground" | ||||||
| > | ||||||
| <IconUpload /> | ||||||
| <Button variant={'outline'}>Upload Logo</Button> | ||||||
| <span className="text-sm font-medium"> | ||||||
| Max size: 15MB, File type: PNG | ||||||
| </span> | ||||||
| </Upload.Button> | ||||||
| </> | ||||||
| )} | ||||||
| </Upload.Root> | ||||||
| </Form.Control> | ||||||
| <Form.Message className="text-destructive" /> | ||||||
|
|
@@ -51,16 +75,11 @@ const Appearance = ({ control }: { control: Control<PmsBranchFormType> }) => { | |||||
| <Form.Label>Color</Form.Label> | ||||||
|
|
||||||
| <Form.Control> | ||||||
| <div | ||||||
| className="relative w-8 h-8 overflow-hidden rounded-full" | ||||||
| style={{ backgroundColor: field.value || '#4F46E5' }} | ||||||
| > | ||||||
| <Input | ||||||
| type="color" | ||||||
| className="absolute inset-0 w-full h-full opacity-0 cursor-pointer" | ||||||
| {...field} | ||||||
| /> | ||||||
| </div> | ||||||
| <ColorPicker | ||||||
| value={field.value} | ||||||
| onValueChange={field.onChange} | ||||||
| className="w-24" | ||||||
| /> | ||||||
| </Form.Control> | ||||||
| <Form.Message className="text-destructive" /> | ||||||
| </Form.Item> | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,8 +17,8 @@ const Discount = ({ control }: { control: Control<PmsBranchFormType> }) => { | |
| </Button> | ||
|
|
||
| {fields.map((field, index) => ( | ||
| <div className="flex gap-6 items-end"> | ||
| <div className="w-full grid grid-cols-3 gap-6"> | ||
| <div className="flex items-end gap-6"> | ||
| <div className="grid w-full grid-cols-3 gap-6"> | ||
| <Form.Field | ||
| control={control} | ||
| name={`discounts.${index}.type`} | ||
|
|
@@ -62,7 +62,7 @@ const Discount = ({ control }: { control: Control<PmsBranchFormType> }) => { | |
| <Button | ||
| variant={'destructive'} | ||
| size={'icon'} | ||
| className="h-8 w-8" | ||
| className="w-8 h-8" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. size-8 gej class baigaa |
||
| onClick={() => remove(index)} | ||
| > | ||
| <IconTrash /> | ||
|
|
||
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.
eniig ustgah empty state iig icon ashiglaj shiideh