Make custom button

This commit is contained in:
toqvist 2024-04-05 19:00:54 +02:00
parent 0645bbd877
commit 1447d8fc17
3 changed files with 14 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form" import { useForm } from "react-hook-form"
import { z } from "zod" import { z } from "zod"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/Button"
import { import {
Form, Form,
FormControl, FormControl,

View File

@ -6,6 +6,7 @@ import L, { LatLngBounds } from 'leaflet';
import { useQuery, useMutation, useQueryClient, queryOptions } from "@tanstack/react-query"; import { useQuery, useMutation, useQueryClient, queryOptions } from "@tanstack/react-query";
import axios from "axios"; import axios from "axios";
import Contacts from './Contacts'; import Contacts from './Contacts';
import { Button } from './ui/Button';
//Todo: Move types to own file //Todo: Move types to own file
interface User { interface User {
@ -240,12 +241,18 @@ export const KiosMap = () => {
<div className='absolute bg-white border-gray-950 border-2 z-[999] left-10 top-1/4 p-4'> <div className='absolute bg-white border-gray-950 border-2 z-[999] left-10 top-1/4 p-4'>
<div className='flex gap-8 flex-col'> <div className='flex gap-8 flex-col'>
{selectedMaker !== undefined && ( {selectedMaker !== undefined && (
<div>
<Contacts <Contacts
name={selectedMaker.name} name={selectedMaker.name}
email={selectedMaker.email} email={selectedMaker.email}
phoneNumber={selectedMaker.phoneNumber} phoneNumber={selectedMaker.phoneNumber}
role={'maker'} role={'maker'}
/> />
<Button
variant="kios"
onClick={() => handleOpenCatalogue()}
>See catalogue</Button>
</div>
)} )}
{selectedRetailer !== undefined && ( {selectedRetailer !== undefined && (
@ -284,12 +291,12 @@ export const KiosMap = () => {
) : ) :
<div> <div>
<h2 className='text-xl font-bold underline-offset-2 underline py-2'>No courier!</h2> <h2 className='text-xl font-bold underline-offset-2 underline py-2'>No courier!</h2>
<button <Button
className="border-2 border-gray-950 py-2 px-4 w-full hover:bg-gray-950 transition-all hover:text-white hover:font-bold" variant={"kios"}
onClick={() => handleAcceptRoute()} onClick={() => handleAcceptRoute()}
> >
Accept route as courier Accept route as courier
</button> </Button>
</div> </div>
} }
</div> </div>

View File

@ -9,6 +9,7 @@ const buttonVariants = cva(
{ {
variants: { variants: {
variant: { variant: {
kios: "border-2 border-gray-950 py-2 px-4 w-full hover:bg-gray-950 transition-all hover:text-white hover:font-bold rounded-none",
default: "bg-primary text-primary-foreground hover:bg-primary/90", default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90", "bg-destructive text-destructive-foreground hover:bg-destructive/90",