Skip to content

Commit 58f51e8

Browse files
Merge pull request #1130 from bancorprotocol/issue-#774
Issue #774 - Update tailwind
2 parents 9b4b0f7 + 3e9059c commit 58f51e8

File tree

278 files changed

+1749
-1986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+1749
-1986
lines changed

.eslintrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
"prettier/prettier": [
3131
"warn",
3232
{ "endOfLine": "auto" }
33+
],
34+
"react/jsx-curly-brace-presence": [
35+
"warn",
36+
{ "props": "never", "children":"never" }
3337
]
3438
},
3539
"overrides": [

README.md

+3-3

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
"react-day-picker": "^8.10.0",
8484
"react-dom": "^18.2.0",
8585
"source-map-explorer": "^2.5.3",
86-
"tailwind-merge": "^1.13.2",
87-
"tailwindcss": "3.1.8",
86+
"tailwind-merge": "^2.2.2",
87+
"tailwindcss": "3.4.3",
8888
"typechain": "^8.1.0",
8989
"typescript": "^5.3.3",
9090
"ua-parser-js": "^1.0.35",
@@ -124,4 +124,4 @@
124124
"devDependencies": {
125125
"@types/d3": "^7.4.3"
126126
}
127-
}
127+
}

src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const App = () => {
3535
<>
3636
<NotificationAlerts />
3737
<MainMenu />
38-
<main className="mt-80 mb-16 flex w-full flex-grow flex-col">
38+
<main className="mb-16 mt-80 flex w-full flex-grow flex-col">
3939
<MainContent />
4040
</main>
4141
<Footer />

src/components/activity/ActivityExport.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ export const ActivityExport: FC<Props> = ({ activities }) => {
7070
return (
7171
<a
7272
href={csvURI}
73-
className="flex items-center gap-8 rounded-full border-2 border-background-800 px-12 py-8 text-12 hover:border-background-700 hover:bg-background-800"
73+
className="border-background-800 text-12 hover:border-background-700 hover:bg-background-800 flex items-center gap-8 rounded-full border-2 px-12 py-8"
7474
download="activities.csv"
7575
>
76-
<IconDownloadFile className="h-14 w-14 text-primary" />
76+
<IconDownloadFile className="text-primary size-14" />
7777
<span>Export</span>
7878
</a>
7979
);

src/components/activity/ActivityFilter.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const ActivityFilter: FC<ActivityFilterProps> = (props) => {
9191
form={formId}
9292
name="ids"
9393
value={ids}
94-
icon={<IconSearch className="w-14 text-primary" />}
94+
icon={<IconSearch className="text-primary w-14" />}
9595
label={
9696
ids.length
9797
? `${ids.length} Strategies Selected`
@@ -116,7 +116,7 @@ export const ActivityFilter: FC<ActivityFilterProps> = (props) => {
116116
form={formId}
117117
name="pairs"
118118
value={pairs}
119-
icon={<IconPair className="w-14 text-primary" />}
119+
icon={<IconPair className="text-primary w-14" />}
120120
label={
121121
pairs.length ? `${pairs.length} Pairs Selected` : 'Filter Pairs'
122122
}
@@ -133,7 +133,7 @@ export const ActivityFilter: FC<ActivityFilterProps> = (props) => {
133133
form={formId}
134134
name="actions"
135135
value={actions}
136-
icon={<IconSearch className="w-14 text-primary" />}
136+
icon={<IconSearch className="text-primary w-14" />}
137137
label={
138138
actions.length
139139
? `${actions.length} Actions Selected`

src/components/activity/ActivityList.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const ActivityList: FC<ActivityListProps> = (props) => {
3838
</ul>
3939
{limit < size && (
4040
<>
41-
<p className="mb-16 text-center text-12 text-white/60">
41+
<p className="text-12 mb-16 text-center text-white/60">
4242
{limit} / {size}
4343
</p>
4444
<Button
@@ -69,10 +69,10 @@ const ActivityItem: FC<ActivityItemProps> = ({ activity, hideIds }) => {
6969
setSearchParams({ actions });
7070
};
7171
return (
72-
<li className="flex flex-col gap-16 rounded border-2 border-background-800">
72+
<li className="border-background-800 flex flex-col gap-16 rounded border-2">
7373
<header className="flex px-16 pt-16">
7474
{!hideIds && <ActivityId activity={activity} size={12} />}
75-
<p className="flex flex-1 items-center justify-end gap-8 font-mono text-12 text-white/60">
75+
<p className="text-12 flex flex-1 items-center justify-end gap-8 font-mono text-white/60">
7676
{activityDateFormatter.format(activity.date)}
7777
<TransactionLink txHash={activity.txHash} className="h-16" />
7878
</p>
@@ -83,17 +83,17 @@ const ActivityItem: FC<ActivityItemProps> = ({ activity, hideIds }) => {
8383
<ActivityIcon activity={activity} size={24} />
8484
{activityActionName[activity.action]}
8585
</h3>
86-
<p className="font-mono text-12 text-white/60">
86+
<p className="text-12 font-mono text-white/60">
8787
{activityDescription(activity)}
8888
</p>
8989
</button>
9090
</section>
9191
<hr className="border-background-800" />
9292
<table className="w-full table-fixed">
9393
<thead>
94-
<tr className="font-mono text-12 text-white/60">
95-
<th className="px-16 font-weight-400">Buy Budget</th>
96-
<th className="px-16 font-weight-400">Sell Budget</th>
94+
<tr className="text-12 font-mono text-white/60">
95+
<th className="font-weight-400 px-16">Buy Budget</th>
96+
<th className="font-weight-400 px-16">Sell Budget</th>
9797
</tr>
9898
</thead>
9999
<tbody>

src/components/activity/ActivityNotification.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const ActivityNotification: FC<Props> = ({ notification, close }) => {
2020
return (
2121
<article aria-labelledby={titleId} className="flex gap-16">
2222
<AnimatedActionIcon action={activity.action} />
23-
<div className="flex flex-1 flex-col gap-8 overflow-hidden text-14">
23+
<div className="text-14 flex flex-1 flex-col gap-8 overflow-hidden">
2424
<hgroup>
2525
<h3 className="text-16" id={titleId} data-testid="notif-title">
2626
{activityActionName[activity.action]}
@@ -32,7 +32,7 @@ export const ActivityNotification: FC<Props> = ({ notification, close }) => {
3232
<Link
3333
to="/strategy/$id"
3434
params={{ id: activity.strategy.id }}
35-
className="flex items-center font-weight-500"
35+
className="font-weight-500 flex items-center"
3636
>
3737
View Activity
3838
</Link>
@@ -43,10 +43,10 @@ export const ActivityNotification: FC<Props> = ({ notification, close }) => {
4343
data-testid="notif-close"
4444
aria-label="Remove notification"
4545
>
46-
<IconClose className="h-14 w-14 text-white/80" />
46+
<IconClose className="size-14 text-white/80" />
4747
</button>
4848

49-
<p className="whitespace-nowrap text-12 font-weight-500 text-white/60">
49+
<p className="text-12 font-weight-500 whitespace-nowrap text-white/60">
5050
{unix(notification.timestamp).fromNow(true)}
5151
</p>
5252
</div>
@@ -59,7 +59,7 @@ export const AnimatedActionIcon = (props: { action: ActivityAction }) => {
5959
return (
6060
<div
6161
className={cn(
62-
'relative grid h-38 w-38 place-items-center rounded-full',
62+
'size-38 relative grid place-items-center rounded-full',
6363
style.icon,
6464
{
6565
'bg-buy/20 text-buy': props.action === 'buy',

src/components/activity/ActivitySection.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const ActivitySection: FC<ActivityFilterProps> = ({ filters = [] }) => {
1111
const { list: activities, all: allActivities } = useActivity();
1212
const { aboveBreakpoint } = useBreakpoints();
1313
return (
14-
<section className="rounded bg-background-900">
14+
<section className="bg-background-900 rounded">
1515
<header className="grid grid-cols-[auto_1fr] gap-16 px-20 py-24 md:grid-cols-[auto_1fr_auto]">
1616
<h2 className="row-start-1">Activity</h2>
1717
<ActivityFilter

src/components/activity/ActivityTable.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const ActivityTable: FC<ActivityListProps> = (props) => {
4949
return (
5050
<table className={cn('w-full border-collapse', style.table)}>
5151
<thead>
52-
<tr className="border-y border-background-800 font-mono text-14 text-white/60">
52+
<tr className="border-background-800 text-14 border-y font-mono text-white/60">
5353
{!hideIds && <th className={thStyle}>ID</th>}
5454
<th className={thStyle} colSpan={2}>
5555
Action
@@ -136,7 +136,7 @@ const ActivityRow: FC<ActivityRowProps> = ({ activity, hideIds, index }) => {
136136
</td>
137137
</tr>
138138
<tr
139-
className="font-mono text-12 text-white/60"
139+
className="text-12 font-mono text-white/60"
140140
style={{ animationDelay: `${index * 50}ms` }}
141141
>
142142
{/* ID */}
@@ -173,7 +173,7 @@ export const ActivityId: FC<ActivityIdProps> = ({ activity, size }) => {
173173
<Link
174174
to="/strategy/$id"
175175
params={{ id: id }}
176-
className="inline-flex items-center gap-4 rounded-full bg-background-800 py-4 px-8"
176+
className="bg-background-800 inline-flex items-center gap-4 rounded-full px-8 py-4"
177177
>
178178
<span className={`text-${size}`}>{getLowestBits(id)}</span>
179179
<TokensOverlap tokens={[base, quote]} size={size + 2} />
@@ -191,7 +191,7 @@ export const ActivityIcon: FC<ActivityIconProps> = (props) => {
191191
const classes = cn(
192192
'grid place-items-center rounded-full',
193193
iconColor(activity.action),
194-
`h-${size} w-${size}`,
194+
`size-${size}`,
195195
className
196196
);
197197
return (
@@ -248,12 +248,12 @@ const ActivityPaginator = () => {
248248
};
249249

250250
return (
251-
<tr className="border-t border-background-800 text-14 text-white/80">
251+
<tr className="border-background-800 text-14 border-t text-white/80">
252252
<td className="px-24 py-16" colSpan={3}>
253253
<div className="flex items-center gap-8">
254254
<label>Show results</label>
255255
<select
256-
className="rounded-full border-2 border-background-800 bg-background-900 px-12 py-8"
256+
className="border-background-800 bg-background-900 rounded-full border-2 px-12 py-8"
257257
name="limit"
258258
onChange={changeLimit}
259259
value={limit}
@@ -285,7 +285,7 @@ const ActivityPaginator = () => {
285285
<IconChevronLeft className="h-12" />
286286
</button>
287287
<p
288-
className="flex gap-8 rounded-full border-2 border-background-800 px-12 py-8"
288+
className="border-background-800 flex gap-8 rounded-full border-2 px-12 py-8"
289289
aria-label="page position"
290290
>
291291
<span className="text-white">{currentPage}</span>
@@ -327,7 +327,7 @@ const iconColor = (action: ActivityAction) => {
327327
};
328328

329329
const ActionIcon: FC<ActionIconProps> = ({ action, size }) => {
330-
const className = `h-${size} w-${size}`;
330+
const className = `size-${size}`;
331331
if (action === 'create') return <IconCheck className={className} />;
332332
if (action === 'transfer') return <IconTransfer className={className} />;
333333
if (action === 'edit') return <IconEdit className={className} />;

src/components/common/Checkbox/Checkbox.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Props = JSX.IntrinsicElements['button'] & {
99

1010
export const Checkbox: FC<Props> = ({ isChecked, setIsChecked, ...attr }) => {
1111
const classNames =
12-
'h-18 w-18 rounded-4 border-2 flex items-center justify-center cursor-pointer';
12+
'size-18 rounded-4 border-2 flex items-center justify-center cursor-pointer';
1313
const borderColor = isChecked
1414
? 'border-primary bg-primary'
1515
: 'border-white/60';
@@ -21,7 +21,7 @@ export const Checkbox: FC<Props> = ({ isChecked, setIsChecked, ...attr }) => {
2121
className={cn(`${classNames} ${borderColor}`, attr.className)}
2222
onClick={() => setIsChecked(!isChecked)}
2323
>
24-
{isChecked && <IconCheck className="h-10 w-10 text-background-900" />}
24+
{isChecked && <IconCheck className="text-background-900 size-10" />}
2525
</button>
2626
);
2727
};

src/components/common/Footer/Footer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { ReactComponent as LogoCarbonDeFi } from 'assets/logos/carbondefi.svg';
44

55
export const Footer: FC = () => {
66
return (
7-
<footer className="mb-80 flex items-center border-t border-background-800 bg-black py-24 px-20 md:mb-0">
7+
<footer className="border-background-800 mb-80 flex items-center border-t bg-black px-20 py-24 md:mb-0">
88
<NewTabLink
99
aria-label="Powered By CarbonDeFi"
1010
to={externalLinks.carbonHomepage}
11-
className="flex items-center gap-8 whitespace-nowrap text-14 font-weight-500 text-white/60"
11+
className="text-14 font-weight-500 flex items-center gap-8 whitespace-nowrap text-white/60"
1212
>
1313
Powered by
1414
<LogoCarbonDeFi className="w-[114px] text-white" />

src/components/common/NotFound.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ export const NotFound = ({
2121
return (
2222
<section
2323
className={cn(
24-
'relative flex min-h-[500px] flex-col items-center justify-center gap-30 px-20 py-50 text-center',
25-
bordered && 'rounded border-2 border-background-800'
24+
'gap-30 py-50 relative flex min-h-[500px] flex-col items-center justify-center px-20 text-center',
25+
bordered && 'border-background-800 rounded border-2'
2626
)}
2727
>
2828
{showBackButton && (
2929
<button
3030
onClick={() => history.back()}
31-
className="absolute top-8 left-8 rounded-full p-16 hover:bg-white/20"
31+
className="absolute left-8 top-8 rounded-full p-16 hover:bg-white/20"
3232
>
33-
<ForwardArrow className="h-16 w-16 rotate-180" />
33+
<ForwardArrow className="size-16 rotate-180" />
3434
</button>
3535
)}
3636
<div
@@ -40,14 +40,14 @@ export const NotFound = ({
4040
})}
4141
>
4242
<IconSearch
43-
className={cn('h-32 w-32', {
43+
className={cn('size-32', {
4444
'text-primary': variant === 'info',
4545
'text-error': variant === 'error',
4646
})}
4747
/>
4848
</div>
4949
<h2 className="max-w-[440px] text-[32px] leading-[36px]">{title}</h2>
50-
<p className="max-w-[440px] text-16 text-white/60">{text}</p>
50+
<p className="text-16 max-w-[440px] text-white/60">{text}</p>
5151
</section>
5252
);
5353
};

src/components/common/PairLogoName.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const PairLogoName: FC<Props> = ({
1616
return (
1717
<>
1818
<TokensOverlap tokens={[baseToken, quoteToken]} size={30} />
19-
<p className="flex items-center gap-4 font-weight-500">
19+
<p className="font-weight-500 flex items-center gap-4">
2020
{baseToken.symbol}
2121
{baseToken.isSuspicious && (
2222
<WarningWithTooltip tooltipContent={suspiciousTokenTooltipMsg} />

src/components/common/Toaster/Toaster.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const Toaster: FC = () => {
88
{toaster.toasts.map((toast) => (
99
<li
1010
key={toast.id}
11-
className="my-5 animate-slideUp rounded-full border border-white/60 bg-background-800 py-8 px-16"
11+
className="animate-slideUp bg-background-800 my-5 rounded-full border border-white/60 px-16 py-8"
1212
>
1313
<output>{toast.content}</output>
1414
</li>

src/components/common/TokenInputField/Slippage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export const Slippage: FC<Props> = ({ slippage }) => {
2626
element={`The slippage is calculated based on the ${selectedFiatCurrency} value difference between the selected source and target tokens.`}
2727
>
2828
<span className={cn('flex flex-1 items-center gap-5', textColor)}>
29-
{slippage?.eq(0) && <IconWarning className="h-12 w-12" />}
29+
{slippage?.eq(0) && <IconWarning className="size-12" />}
3030
{slippage?.gt(0) && <>(+{slippageValue}%)</>}
3131
{slippage?.lt(0) && <>(-{slippageValue}%)</>}
3232
{slippage?.eq(0) && <>Notice: price & slippage are unknown</>}
33-
{slippage.lt(-3) && <IconWarning className="h-12 w-12" />}
33+
{slippage.lt(-3) && <IconWarning className="size-12" />}
3434
</span>
3535
</Tooltip>
3636
);

0 commit comments

Comments
 (0)