Skip to content

Commit 236d2c7

Browse files
committed
style(panel): removed forced TxAnchor margin
1 parent 26c4971 commit 236d2c7

6 files changed

Lines changed: 34 additions & 21 deletions

File tree

panel/src/components/TxAnchor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function InnerExternal({ text }: { text: string }) {
1616
<span className="whitespace-nowrap">
1717
{lastWord}
1818
<ExternalLinkIcon
19-
className="inline ml-1 mb-1 h-5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0 selection:bg-inherit"
19+
className="inline ml-1 mb-1 h-5 -mr-0.5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0 [.text-sm_&]:-mr-1 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0 [.prose-sm_&]:-mr-0.5 selection:bg-inherit"
2020
/>
2121
</span>
2222
</>
@@ -46,7 +46,7 @@ export default function TxAnchor({ children, href, className, rel, ...rest }: Tx
4646
rel={rel ?? 'noopener noreferrer'}
4747
href={href}
4848
className={cn(
49-
'text-accent no-underline hover:underline ml-1 mr-0 cursor-pointer',
49+
'text-accent no-underline hover:underline cursor-pointer',
5050
className
5151
)}
5252
onClick={onClick}

panel/src/pages/Diagnostics/DiagnosticsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function DiagnosticsPage() {
5555
Support Team. <br />
5656
After that, share the report ID with the support team in <TxAnchor
5757
href="https://discord.gg/uAmsGa2"
58-
className="m-0 font-semibold tracking-wide text-primary"
58+
className="font-semibold tracking-wide text-primary"
5959
>
6060
discord.gg/txAdmin
6161
</TxAnchor>.

panel/src/pages/Diagnostics/report-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const SuccessContent = ({ reportId }: { reportId: string }) => (
105105
<p className="text-muted-foreground pt-2">
106106
Please send this ID to the support team in <TxAnchor
107107
href="https://discord.gg/uAmsGa2"
108-
className="m-0 font-semibold tracking-wide text-primary"
108+
className="font-semibold tracking-wide text-primary"
109109
>
110110
discord.gg/txAdmin
111111
</TxAnchor>.

panel/src/pages/Settings/tabCards/discord.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,10 @@ export default function ConfigCardDiscord({ cardCtx, pageCtx }: SettingsCardProp
124124
required
125125
/>
126126
<SettingItemDesc>
127-
To get a token and the bot to join your server, follow these two guides:
128-
<TxAnchor href="https://discordjs.guide/preparations/setting-up-a-bot-application.html">Setting up a bot application</TxAnchor> and <TxAnchor href="https://discordjs.guide/preparations/adding-your-bot-to-servers.html">Adding your bot to servers</TxAnchor> <br />
127+
To get a token and the bot to join your server, follow these two guides: <br />
128+
<TxAnchor href="https://discordjs.guide/preparations/setting-up-a-bot-application.html">Setting up a bot application</TxAnchor> and <TxAnchor href="https://discordjs.guide/preparations/adding-your-bot-to-servers.html">Adding your bot to servers</TxAnchor> <br />
129129
<strong>Note:</strong> Do not reuse the same token for another bot. <br />
130-
<strong>Note:</strong> The bot requires the <strong>Server Members</strong> intent, which can be set at the
131-
<TxAnchor href="https://discord.com/developers/applications">Discord Developer Portal</TxAnchor>.
130+
<strong>Note:</strong> The bot requires the <strong>Server Members</strong> intent, which can be set at the <TxAnchor href="https://discord.com/developers/applications">Discord Developer Portal</TxAnchor>.
132131
</SettingItemDesc>
133132
</SettingItem>
134133
<SettingItem label="Guild/Server ID" htmlFor={cfg.discordGuild.eid} required={states.botEnabled}>
@@ -142,8 +141,7 @@ export default function ConfigCardDiscord({ cardCtx, pageCtx }: SettingsCardProp
142141
/>
143142
<SettingItemDesc>
144143
The ID of the Discord Server (also known as Discord Guild). <br />
145-
To get the Server ID, go to Discord's settings and
146-
<TxAnchor href="https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png"> enable developer mode</TxAnchor>, then right-click on the guild icon select "Copy ID".
144+
To get the Server ID, go to Discord's settings and <TxAnchor href="https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png">enable developer mode</TxAnchor>, then right-click on the guild icon select "Copy ID".
147145
</SettingItemDesc>
148146
</SettingItem>
149147
<SettingItem label="Warnings Channel ID" htmlFor={cfg.warningsChannel.eid} showOptional>
@@ -158,8 +156,7 @@ export default function ConfigCardDiscord({ cardCtx, pageCtx }: SettingsCardProp
158156
<SettingItemDesc>
159157
The ID of the channel to send Announcements (eg server restarts). <br />
160158
You can leave it blank to disable this feature. <br />
161-
To get the channel ID, go to Discord's settings and
162-
<TxAnchor href="https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png"> enable developer mode</TxAnchor>, then right-click on the channel name and select "Copy ID".
159+
To get the channel ID, go to Discord's settings and <TxAnchor href="https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png">enable developer mode</TxAnchor>, then right-click on the channel name and select "Copy ID".
163160
</SettingItemDesc>
164161
</SettingItem>
165162
{/* <SettingItem label="Status Embed">

panel/src/pages/Settings/tabCards/gameNotifications.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default function ConfigCardGameNotifications({ cardCtx, pageCtx }: Settin
9393
/>
9494
<SettingItemDesc>
9595
Suppresses the display of announcements, allowing you to implement your own announcement via the event <InlineCode>txAdmin:events:announcement</InlineCode>.
96-
<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsannouncement">Documentation</TxAnchor>
96+
&nbsp;<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsannouncement">Documentation</TxAnchor>
9797
</SettingItemDesc>
9898
</SettingItem>
9999
<SettingItem label="Hide Direct Message Notification">
@@ -107,7 +107,7 @@ export default function ConfigCardGameNotifications({ cardCtx, pageCtx }: Settin
107107
/>
108108
<SettingItemDesc>
109109
Suppresses the display of direct messages, allowing you to implement your own direct message notification via the event <InlineCode>txAdmin:events:playerDirectMessage</InlineCode>.
110-
<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsplayerdirectmessage">Documentation</TxAnchor>
110+
&nbsp;<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsplayerdirectmessage">Documentation</TxAnchor>
111111
</SettingItemDesc>
112112
</SettingItem>
113113
<SettingItem label="Hide Warning Notification">
@@ -121,7 +121,7 @@ export default function ConfigCardGameNotifications({ cardCtx, pageCtx }: Settin
121121
/>
122122
<SettingItemDesc>
123123
Suppresses the display of warnings, allowing you to implement your own warning via the event <InlineCode>txAdmin:events:playerWarned</InlineCode>.
124-
<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsplayerwarned">Documentation</TxAnchor>
124+
&nbsp;<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsplayerwarned">Documentation</TxAnchor>
125125
</SettingItemDesc>
126126
</SettingItem>
127127
<SettingItem label="Hide Scheduled Restart Warnings">
@@ -135,7 +135,7 @@ export default function ConfigCardGameNotifications({ cardCtx, pageCtx }: Settin
135135
/>
136136
<SettingItemDesc>
137137
Suppresses the display of scheduled restart warnings, allowing you to implement your own warning via the event <InlineCode>txAdmin:events:scheduledRestart</InlineCode>.
138-
<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsscheduledrestart">Documentation</TxAnchor>
138+
&nbsp;<TxAnchor href="https://aka.cfx.re/txadmin-events#txadmineventsscheduledrestart">Documentation</TxAnchor>
139139
</SettingItemDesc>
140140
</SettingItem>
141141
</SettingsCardShell>

panel/src/pages/TestingPage/TmpLibraryShowcase.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,29 @@ export default function TmpLibraryShowcase() {
308308

309309
<div className="space-y-4">
310310
<h3 className="text-lg font-medium">TxAnchor</h3>
311-
<p className="text-sm">
311+
<p className="text-muted-foreground">
312312
Smart anchor component that handles internal navigation and external links properly.
313-
External links open in a new tab with an icon: <TxAnchor href="https://github.com/tabarra/txAdmin">txAdmin GitHub</TxAnchor>
314-
</p>
315-
<p className="text-sm">
316-
Internal links use wouter navigation: <TxAnchor href="/players">Players Page</TxAnchor>
317313
</p>
314+
315+
<div className="space-y-2">
316+
<h4 className="text-sm font-medium text-muted-foreground">Normal text size:</h4>
317+
<p>
318+
Lorem ipsum dolor <TxAnchor href="/players">Example</TxAnchor>: internal link.
319+
</p>
320+
<p>
321+
Lorem ipsum dolor <TxAnchor href="https://github.com/tabarra/txAdmin">Example</TxAnchor>: external link.
322+
</p>
323+
</div>
324+
325+
<div className="space-y-2">
326+
<h4 className="text-sm font-medium text-muted-foreground">Small text size (text-sm):</h4>
327+
<p className="text-sm">
328+
Lorem ipsum dolor <TxAnchor href="/dashboard">Example</TxAnchor>: internal link.
329+
</p>
330+
<p className="text-sm">
331+
Lorem ipsum dolor <TxAnchor href="https://discord.gg/txAdmin">Example</TxAnchor>: external link.
332+
</p>
333+
</div>
318334
</div>
319335
</section>
320336

0 commit comments

Comments
 (0)