Skip to content

Commit

Permalink
Merge pull request #1982 from zeitgeistpm/tw-prettier
Browse files Browse the repository at this point in the history
Tailwind Prettier
  • Loading branch information
Robiquet authored Nov 16, 2023
2 parents f52cb02 + 9283503 commit b6f6ce3
Show file tree
Hide file tree
Showing 173 changed files with 15,675 additions and 1,388 deletions.
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
tabWidth: 2,
singleQuote: false,
semi: true,
plugins: ["prettier-plugin-tailwindcss"],
};
366 changes: 183 additions & 183 deletions LICENSE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const Account = () => {
return (
<>
<Modal open={accountSelectModalOpen} onClose={closeAccountSelect}>
<Dialog.Panel className="bg-white rounded-ztg-10 p-[15px]">
<Dialog.Panel className="rounded-ztg-10 bg-white p-[15px]">
<div className="mb-3">
<AccountModalHead />
</div>
Expand Down
46 changes: 23 additions & 23 deletions components/account/AccountButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const BalanceRow = ({
<div className="flex items-center">
<img src={imgPath} height={"24px"} width="24px" />
<div
className={`group font-bold flex w-full items-center rounded-md px-2 py-2 text-sm`}
className={`group flex w-full items-center rounded-md px-2 py-2 text-sm font-bold`}
>
{balance &&
`${formatNumberLocalized(balance?.div(ZTG).abs().toNumber())} ${
Expand All @@ -66,7 +66,7 @@ const HeaderActionButton: FC<
> = ({ onClick, disabled, children }) => {
return (
<button
className={`w-[185px] flex border-2 rounded-full px-6 leading-[40px] text-white font-medium items-center border-white justify-center cursor-pointer disabled:cursor-default disabled:opacity-30`}
className={`flex w-[185px] cursor-pointer items-center justify-center rounded-full border-2 border-white px-6 font-medium leading-[40px] text-white disabled:cursor-default disabled:opacity-30`}
onClick={onClick}
disabled={disabled}
>
Expand Down Expand Up @@ -167,7 +167,7 @@ const AccountButton: FC<{

{hovering === true &&
(locationAllowed !== true || isUsingVPN === true) ? (
<div className="bg-white absolute text-sm rounded font-bold text-black right-0 bottom-0">
<div className="absolute bottom-0 right-0 rounded bg-white text-sm font-bold text-black">
{locationAllowed !== true
? "Your jurisdiction is not authorised to trade"
: "Trading over a VPN is not allowed due to legal restrictions"}
Expand All @@ -182,23 +182,23 @@ const AccountButton: FC<{
{({ open }) => (
<>
<div>
<div className="flex h-11 relative">
<div className="relative flex h-11">
<Menu.Button>
<div
className={`relative flex flex-1 items-center justify-end h-full rounded-full cursor-pointer z-30 ${
className={`relative z-30 flex h-full flex-1 cursor-pointer items-center justify-end rounded-full ${
open
? "border-orange-500"
: pathname === "/"
? " border-white"
: "border-black"
? " border-white"
: "border-black"
}`}
>
<div
className={`flex items-center rounded-full h-full border-2 pl-1.5 py-1 md:py-0 bg-black transition-all text-white ${
className={`flex h-full items-center rounded-full border-2 bg-black py-1 pl-1.5 text-white transition-all md:py-0 ${
open ? "border-sunglow-2" : "border-white"
}`}
>
<div className={`ring-2 rounded-full`}>
<div className={`rounded-full ring-2`}>
{activeAccount?.address && (
<Avatar
zoomed
Expand All @@ -208,7 +208,7 @@ const AccountButton: FC<{
)}
</div>
<span
className={`font-medium pl-2 text-sm h-full transition-all hidden md:block leading-[40px] ${
className={`hidden h-full pl-2 text-sm font-medium leading-[40px] transition-all md:block ${
open ? "text-sunglow-2" : "text-white"
}`}
>
Expand All @@ -234,11 +234,11 @@ const AccountButton: FC<{
<>
<Popover.Button className="relative z-20 focus:outline-none">
<div
className={`h-11 -ml-4 pl-6 z-rounded-r-full z-50 ${
className={`z-rounded-r-full z-50 -ml-4 h-11 pl-6 ${
open
? "bg-gradient-to-r from-purple-500 to-purple-500"
: "bg-gradient-to-r from-purple-700 to-purple-500"
} rounded-r-full center pr-4 text-purple-900`}
} center rounded-r-full pr-4 text-purple-900`}
>
<FaNetworkWired size={18} />
</div>
Expand All @@ -253,15 +253,15 @@ const AccountButton: FC<{
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 :scale-95"
>
<Popover.Panel className="absolute z-10 right-0 bottom-6 translate-y-[100%] w-64">
<Popover.Panel className="absolute bottom-6 right-0 z-10 w-64 translate-y-[100%]">
<div className="flex items-center">
<div className="flex items-center bg-purple-500 p-4 pt-8 w-full rounded-md rounded-tr-none">
<div className="flex w-full items-center rounded-md rounded-tr-none bg-purple-500 p-4 pt-8">
<div className="flex-1">
<label className="text-purple-900 text-xs italic mb-2">
<label className="mb-2 text-xs italic text-purple-900">
Account is acting proxy for:
</label>
<div className="flex items-center gap-1">
<div className="text-white text-sm">
<div className="text-sm text-white">
{realAddress &&
shortenAddress(realAddress, 7, 7)}
</div>
Expand Down Expand Up @@ -294,9 +294,9 @@ const AccountButton: FC<{
leaveFrom="transform opacity-100 translate-y-0 md:scale-100"
leaveTo="transform opacity-0 translate-y-2 md:translate-y-0 md:scale-95"
>
<Menu.Items className="fixed md:absolute left-0 md:left-auto md:right-0 py-3 z-40 mt-3 md:mt-6 w-full overflow-hidden h-full md:h-auto md:w-64 origin-top-right divide-y divide-gray-100 md:rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<Menu.Items className="fixed left-0 z-40 mt-3 h-full w-full origin-top-right divide-y divide-gray-100 overflow-hidden bg-white py-3 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none md:absolute md:left-auto md:right-0 md:mt-6 md:h-auto md:w-64 md:rounded-md">
<div className="">
<div className="flex flex-col gap-2 border-b-2 mb-3 py-2 px-6">
<div className="mb-3 flex flex-col gap-2 border-b-2 px-6 py-2">
<BalanceRow
imgPath="/currencies/ztg.jpg"
units={constants?.tokenSymbol}
Expand All @@ -313,7 +313,7 @@ const AccountButton: FC<{
href={`/portfolio/${realAddress}?mainTab=Balances`}
className="mt-3"
>
<div className="flex items-center mb-3">
<div className="mb-3 flex items-center">
<div className="text-xs font-medium">
Go to Balances
</div>
Expand All @@ -329,7 +329,7 @@ const AccountButton: FC<{
<Menu.Item>
{({ active }) => (
<div
className="flex items-center px-6 mb-3 hover:bg-slate-100"
className="mb-3 flex items-center px-6 hover:bg-slate-100"
onClick={() => setShowGetZtgModal(true)}
>
<DollarSign />
Expand All @@ -345,7 +345,7 @@ const AccountButton: FC<{
<Menu.Item>
{({ active }) => (
<div
className="flex items-center px-6 mb-3 hover:bg-slate-100"
className="mb-3 flex items-center px-6 hover:bg-slate-100"
onClick={() => {
accountModals.openAccountSelect();
}}
Expand All @@ -363,7 +363,7 @@ const AccountButton: FC<{
<Menu.Item>
{({ active }) => (
<Link href={`/portfolio/${realAddress}`}>
<div className="flex items-center px-6 mb-3 hover:bg-slate-100">
<div className="mb-3 flex items-center px-6 hover:bg-slate-100">
<BarChart />
<button
className={`group flex w-full items-center rounded-md px-2 py-2 text-sm font-semibold`}
Expand All @@ -377,7 +377,7 @@ const AccountButton: FC<{
<Menu.Item>
{({ active }) => (
<div
className="flex items-center px-6 mb-3 cursor-pointer hover:bg-slate-100"
className="mb-3 flex cursor-pointer items-center px-6 hover:bg-slate-100"
onClick={() => setShowSettingsModal(true)}
>
<Settings />
Expand Down
18 changes: 9 additions & 9 deletions components/account/AccountModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ const AccountModalContent: FC = () => {
value={value}
onChange={onAccountChange}
/>
<div className="flex items-center justify-between h-ztg-50 mt-ztg-15">
<div className="rounded-ztg-10 h-full bg-sky-100 dark:bg-black flex items-center flex-grow">
<div className="px-ztg-8 flex items-center">
<div className="center rounded-full w-ztg-28 h-ztg-28 bg-white dark:bg-sky-1000">
<div className="center rounded-full w-ztg-22 h-ztg-22 bg-sky-100 dark:bg-black">
<div className="center rounded-full w-ztg-16 h-ztg-16 bg-border-dark dark:bg-sky-1000">
<div className="mt-ztg-15 flex h-ztg-50 items-center justify-between">
<div className="flex h-full flex-grow items-center rounded-ztg-10 bg-sky-100 dark:bg-black">
<div className="flex items-center px-ztg-8">
<div className="center h-ztg-28 w-ztg-28 rounded-full bg-white dark:bg-sky-1000">
<div className="center h-ztg-22 w-ztg-22 rounded-full bg-sky-100 dark:bg-black">
<div className="center h-ztg-16 w-ztg-16 rounded-full bg-border-dark dark:bg-sky-1000">
<img
src="/icons/acc-balance.svg"
alt="Account balance"
Expand All @@ -54,7 +54,7 @@ const AccountModalContent: FC = () => {
</div>
</div>
<div className="ml-ztg-16 flex flex-col">
<div className="uppercase text-ztg-10-150 font-bold text-sky-600">
<div className="text-ztg-10-150 font-bold uppercase text-sky-600">
balance
</div>
<div className="font-mono text-ztg-14-120 font-bold text-sheen-green">
Expand All @@ -66,13 +66,13 @@ const AccountModalContent: FC = () => {
</div>
</div>
<div
className="flex justify-evenly items-center w-ztg-176 bg-border-light dark:bg-sky-700 ml-ztg-16 rounded-ztg-10 h-full text-white cursor-pointer"
className="ml-ztg-16 flex h-full w-ztg-176 cursor-pointer items-center justify-evenly rounded-ztg-10 bg-border-light text-white dark:bg-sky-700"
onClick={() => {
disconnectWallet();
}}
>
<div className=" text-ztg-16-150 capitalize">disconnect</div>
<LogOut size={16} className="text-white -ml-ztg-30" />
<LogOut size={16} className="-ml-ztg-30 text-white" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/account/AccountModalHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const AccountModalHead = () => {

return (
<div className="flex flex-row justify-between">
<div className="font-bold text-ztg-16-150 text-black">Account</div>
<div className="text-ztg-16-150 font-bold text-black">Account</div>
<div
className="mr-ztg-7 cursor-pointer underline"
onClick={() => {
Expand Down
6 changes: 3 additions & 3 deletions components/account/AccountSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type AccountOption = { label: string; value: string };
const Control = ({ children, ...rest }: ControlProps<AccountOption, false>) => {
return (
<components.Control {...(rest as ControlProps)}>
<div className="flex items-center bg-sky-100 dark:bg-black justify-between cursor-pointer rounded-ztg-10">
<div className="flex cursor-pointer items-center justify-between rounded-ztg-10 bg-sky-100 dark:bg-black">
{children}
</div>
</components.Control>
Expand Down Expand Up @@ -100,7 +100,7 @@ const AccountSelect: FC<AccountSelectProps> = ({
const wallet = useWallet();

return (
<div className="flex h-ztg-50 items-center bg-sky-100 dark:bg-black rounded-ztg-10 w-full">
<div className="flex h-ztg-50 w-full items-center rounded-ztg-10 bg-sky-100 dark:bg-black">
<div className="flex-1">
<Select
isSearchable={false}
Expand All @@ -124,7 +124,7 @@ const AccountSelect: FC<AccountSelectProps> = ({
{wallet.activeAccount?.address && (
<CopyIcon
copyText={wallet.activeAccount?.address}
className="pr-ztg-8 w-auto"
className="w-auto pr-ztg-8"
size={16}
/>
)}
Expand Down
10 changes: 5 additions & 5 deletions components/account/AccountSelectOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ export interface AccountSelectRowProps {

const AccountSelectOption: FC<AccountSelectRowProps> = ({ name, address }) => {
return (
<div className="flex p-ztg-8 items-center bg-sky-100 dark:bg-black cursor-pointer text-black dark:text-white">
<div className="center rounded-full w-ztg-28 h-ztg-28">
<div className="mr-4 rounded-full w-ztg-22 h-ztg-22 bg-sky-100 dark:bg-black">
<div className="flex cursor-pointer items-center bg-sky-100 p-ztg-8 text-black dark:bg-black dark:text-white">
<div className="center h-ztg-28 w-ztg-28 rounded-full">
<div className="mr-4 h-ztg-22 w-ztg-22 rounded-full bg-sky-100 dark:bg-black">
<Avatar zoomed address={address} />
</div>
</div>
<div className="flex flex-col mr-ztg-10">
<div className="mr-ztg-10 flex flex-col">
<div className="text-ztg-12-120 font-medium">{name}</div>
<div className="font-mono text-ztg-12-120 font-semibold md:hidden">
{shortenAddress(address, 12, 12)}
</div>
<div className="font-mono text-ztg-12-120 font-semibold hidden md:block">
<div className="hidden font-mono text-ztg-12-120 font-semibold md:block">
{address}
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions components/account/AccountSelectValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ export interface AccountSelectValueProps {

const AccountSelectValue: FC<AccountSelectValueProps> = ({ name, address }) => {
return (
<div className="flex items-center h-full w-full px-ztg-8 bg-sky-100 dark:bg-black rounded-ztg-10">
<div className="center rounded-full w-ztg-28 h-ztg-28 bg-white dark:bg-sky-1000">
<div className="rounded-full w-ztg-22 h-ztg-22 bg-sky-100 dark:bg-black">
<div className="flex h-full w-full items-center rounded-ztg-10 bg-sky-100 px-ztg-8 dark:bg-black">
<div className="center h-ztg-28 w-ztg-28 rounded-full bg-white dark:bg-sky-1000">
<div className="h-ztg-22 w-ztg-22 rounded-full bg-sky-100 dark:bg-black">
<Avatar zoomed address={address} />
</div>
</div>
<div className="flex flex-col ml-ztg-16">
<div className="font-bold text-sky-600 text-ztg-10-150 uppercase">
<div className="ml-ztg-16 flex flex-col">
<div className="text-ztg-10-150 font-bold uppercase text-sky-600">
{name}
</div>
<div className="font-mono text-ztg-12-120 font-semibold md:hidden">
{shortenAddress(address, 8, 12)}
</div>
<div className="font-mono text-ztg-12-120 font-semibold hidden md:block">
<div className="hidden font-mono text-ztg-12-120 font-semibold md:block">
{address}
</div>
</div>
Expand Down
Loading

0 comments on commit b6f6ce3

Please sign in to comment.