Skip to content
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

Fix : Trying to deploy to vercel instead #8

Merged
merged 9 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/deployAction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deployement to Vercel
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vercel
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

215 changes: 123 additions & 92 deletions src/components/Elements/PopUp/PopUp.tsx
Original file line number Diff line number Diff line change
@@ -1,104 +1,135 @@
import { Fragment, useState } from 'react'
import { Dialog, Transition } from '@headlessui/react'
import { ExclamationTriangleIcon, InformationCircleIcon, CheckCircleIcon } from '@heroicons/react/24/outline'
import { Fragment, useState } from "react";
import { Dialog, Transition } from "@headlessui/react";
import {
ExclamationTriangleIcon,
InformationCircleIcon,
CheckCircleIcon,
} from "@heroicons/react/24/outline";
import Button from "../Button";

interface Props{
textAlert?: string;
buttonCancelText: string;
buttonProceedText?: string;
type: "warning" | "success" | "info" |"danger";
title: string;
onClickProceed?:any;
interface Props {
textAlert?: string;
buttonCancelText: string;
buttonProceedText?: string;
type: "warning" | "success" | "info" | "danger";
title: string;
onClickProceed?: () => void;
}
const PopUp = ({textAlert, type, title, onClickProceed, buttonCancelText, buttonProceedText}: Props) => {
const [open, setOpen] = useState(true)
const PopUp = ({

Check warning on line 18 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L18

Added line #L18 was not covered by tests
textAlert,
type,
title,
onClickProceed,
buttonCancelText,
buttonProceedText,
}: Props) => {
const [open, setOpen] = useState(true);

Check warning on line 26 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L25-L26

Added lines #L25 - L26 were not covered by tests

let iconComponent;
let iconColor;
switch (type) {
case "warning":
iconComponent = <ExclamationTriangleIcon className="h-6 w-6" aria-hidden="true" />;
iconColor = "text-warning";
break;
case "danger":
iconComponent = <ExclamationTriangleIcon className="h-6 w-6" aria-hidden="true" />;
iconColor = "text-danger";
break;
case "success":
iconComponent = <CheckCircleIcon className="h-6 w-6" aria-hidden="true" />;
iconColor = "text-green";
break;
case "info":
iconComponent = <InformationCircleIcon className="h-6 w-6" aria-hidden="true" />;
iconColor = "text-primaryColor";
break;
default:
iconComponent = null;
iconColor = "text-primaryColor";
}
let iconComponent;
let iconColor;
switch (type) {
case "warning":
iconComponent = (

Check warning on line 32 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L31-L32

Added lines #L31 - L32 were not covered by tests
<ExclamationTriangleIcon className="h-6 w-6" aria-hidden="true" />
);
iconColor = "text-warning";
break;
case "danger":
iconComponent = (

Check warning on line 38 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L35-L38

Added lines #L35 - L38 were not covered by tests
<ExclamationTriangleIcon className="h-6 w-6" aria-hidden="true" />
);
iconColor = "text-danger";
break;
case "success":
iconComponent = (

Check warning on line 44 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L41-L44

Added lines #L41 - L44 were not covered by tests
<CheckCircleIcon className="h-6 w-6" aria-hidden="true" />
);
iconColor = "text-green";
break;
case "info":
iconComponent = (

Check warning on line 50 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L47-L50

Added lines #L47 - L50 were not covered by tests
<InformationCircleIcon className="h-6 w-6" aria-hidden="true" />
);
iconColor = "text-primaryColor";
break;
default:
iconComponent = null;
iconColor = "text-primaryColor";

Check warning on line 57 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L53-L57

Added lines #L53 - L57 were not covered by tests
}

return (

Check warning on line 60 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L60

Added line #L60 was not covered by tests
<Transition.Root show={open} as={Fragment}>
<Dialog as="div" className="relative z-10" onClose={setOpen}>
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div className="fixed inset-0 bg-stroke bg-opacity-50 transition-opacity" />
</Transition.Child>

return (
<Transition.Root show={open} as={Fragment}>
<Dialog as="div" className="relative z-10" onClose={setOpen}>
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div className="fixed inset-0 bg-stroke bg-opacity-50 transition-opacity" />
</Transition.Child>

<div className="fixed inset-0 z-10 w-screen overflow-y-auto">
<div className="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
enterTo="opacity-100 translate-y-0 sm:scale-100"
leave="ease-in duration-200"
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel className="relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg">
<div className="bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
<div className="sm:flex sm:items-start">
<div className="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10">
{/* Render the icon with its color based on type */}
{iconComponent && <div className={iconColor}>{iconComponent}</div>}
</div>

<div className="mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left">
<Dialog.Title as="h3" className="text-base font-semibold leading-6 text-gray-900">
{title}
</Dialog.Title>
<div className="mt-2">
<p className="text-sm text-gray-500">
{textAlert}
</p>
</div>
</div>
</div>
</div>
<div className="bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6">
{ (buttonProceedText) && onClickProceed &&
<Button text={buttonProceedText} styleType={type} onClick={() => onClickProceed}/>}
<div className="fixed inset-0 z-10 w-screen overflow-y-auto">
<div className="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
enterTo="opacity-100 translate-y-0 sm:scale-100"
leave="ease-in duration-200"
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel className="relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg">
<div className="bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
<div className="sm:flex sm:items-start">
<div className="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10">
{/* Render the icon with its color based on type */}
{iconComponent && (
<div className={iconColor}>{iconComponent}</div>

Check warning on line 92 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L92

Added line #L92 was not covered by tests
)}
</div>

<Button text={buttonCancelText} styleType={"neutral"} className={"mr-3"} onClick={() => setOpen(false)}/>
</div>
</Dialog.Panel>
</Transition.Child>
<div className="mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left">
<Dialog.Title
as="h3"
className="text-base font-semibold leading-6 text-gray-900"
>
{title}
</Dialog.Title>
<div className="mt-2">
<p className="text-sm text-gray-500">{textAlert}</p>
</div>
</div>
</div>
</div>
</Dialog>
</Transition.Root>
)
}
<div className="bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6">
{buttonProceedText && onClickProceed && (
<Button

Check warning on line 111 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L111

Added line #L111 was not covered by tests
text={buttonProceedText}
styleType={type}
onClick={() => onClickProceed()} // Corrected onClick event

Check warning on line 114 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L114

Added line #L114 was not covered by tests
/>
)}

<Button
text={buttonCancelText}
styleType={"neutral"}
className={"mr-3"}
onClick={() => setOpen(false)}

Check warning on line 122 in src/components/Elements/PopUp/PopUp.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Elements/PopUp/PopUp.tsx#L122

Added line #L122 was not covered by tests
/>
</div>
</Dialog.Panel>
</Transition.Child>
</div>
</div>
</Dialog>
</Transition.Root>
);
};
/*
usage of popup:

Expand Down
110 changes: 110 additions & 0 deletions src/features/clockSettings/data/timezones.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
export const utcTimezones = [

Check warning on line 1 in src/features/clockSettings/data/timezones.ts

View check run for this annotation

Codecov / codecov/patch

src/features/clockSettings/data/timezones.ts#L1

Added line #L1 was not covered by tests
{
id: 12,
name: "(UTC-12) International Date Line West",
},
{
id: 11,
name: "(UTC-11) Coordinated Universal Time-11",
},
{
id: 10,
name: "(UTC-10) Hawaii",
},
{
id: 9,
name: "(UTC-9) Alaska",
},
{
id: 8,
name: "(UTC-8) Pacific Time (US & Canada)",
},
{
id: 7,
name: "(UTC-7) Mountain Time (US & Canada)",
},
{
id: 6,
name: "(UTC-6) Central Time (US & Canada)",
},
{
id: 5,
name: "(UTC-5) Eastern Time (US & Canada)",
},
{
id: 4,
name: "(UTC-4) Atlantic Time (Canada)",
},
{
id: 3,
name: "(UTC-3) Buenos Aires",
},
{
id: 2,
name: "(UTC-2) Coordinated Universal Time-02",
},
{
id: 1,
name: "(UTC-1) Azores",
},
{
id: 0,
name: "(UTC) Coordinated Universal Time",
},
{
id: -1,
name: "(UTC+1) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
},
{
id: -2,
name: "(UTC+2) Athens, Bucharest, Istanbul",
},
{
id: -3,
name: "(UTC+3) Moscow, St. Petersburg, Volgograd",
},
{
id: -4,
name: "(UTC+4) Abu Dhabi, Muscat",
},
{
id: -5,
name: "(UTC+5) Islamabad, Karachi",
},
{
id: -6,
name: "(UTC+6) Dhaka",
},
{
id: -7,
name: "(UTC+7) Bangkok, Hanoi, Jakarta",
},
{
id: -8,
name: "(UTC+8) Beijing, Chongqing, Hong Kong, Urumqi",
},
{
id: -9,
name: "(UTC+9) Osaka, Sapporo, Tokyo",
},
{
id: -10,
name: "(UTC+10) Brisbane",
},
{
id: -11,
name: "(UTC+11) Solomon Is., New Caledonia",
},
{
id: -12,
name: "(UTC+12) Fiji",
},
{
id: -13,
name: "(UTC+13) Nuku'alofa",
},
{
id: -14,
name: "(UTC+14) Kiritimati Island",
},
];
Loading
Loading