Skip to content

Commit

Permalink
chore: make buttons tiny
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Feb 2, 2025
1 parent d096505 commit a01d769
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 36 deletions.
38 changes: 19 additions & 19 deletions web/default/src/components/ChannelsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ const ChannelsTable = () => {
newChannels[realIdx].response_time = time * 1000;
newChannels[realIdx].test_time = Date.now() / 1000;
setChannels(newChannels);
showSuccess(t('channel.messages.test_success', { name, model, time, message }));
showSuccess(
t('channel.messages.test_success', { name, model, time, message })
);
} else {
showError(message);
}
Expand All @@ -350,7 +352,9 @@ const ChannelsTable = () => {
const res = await API.delete(`/api/channel/disabled`);
const { success, message, data } = res.data;
if (success) {
showSuccess(t('channel.messages.delete_disabled_success', { count: data }));
showSuccess(
t('channel.messages.delete_disabled_success', { count: data })
);
await refresh();
} else {
showError(message);
Expand Down Expand Up @@ -591,7 +595,7 @@ const ChannelsTable = () => {
<Table.Cell>
<div>
<Button
size={'small'}
size={'tiny'}
positive
onClick={() => {
testChannel(
Expand All @@ -606,7 +610,7 @@ const ChannelsTable = () => {
</Button>
<Popup
trigger={
<Button size='small' negative>
<Button size='tiny' negative>
{t('channel.buttons.delete')}
</Button>
}
Expand All @@ -615,6 +619,7 @@ const ChannelsTable = () => {
hoverable
>
<Button
size={'tiny'}
negative
onClick={() => {
manageChannel(channel.id, 'delete', idx);
Expand All @@ -624,7 +629,7 @@ const ChannelsTable = () => {
</Button>
</Popup>
<Button
size={'small'}
size={'tiny'}
onClick={() => {
manageChannel(
channel.id,
Expand All @@ -638,7 +643,7 @@ const ChannelsTable = () => {
: t('channel.buttons.enable')}
</Button>
<Button
size={'small'}
size={'tiny'}
as={Link}
to={'/channel/edit/' + channel.id}
>
Expand All @@ -654,16 +659,11 @@ const ChannelsTable = () => {
<Table.Footer>
<Table.Row>
<Table.HeaderCell colSpan={showDetail ? '10' : '8'}>
<Button
size='small'
as={Link}
to='/channel/add'
loading={loading}
>
<Button size='tiny' as={Link} to='/channel/add' loading={loading}>
{t('channel.buttons.add')}
</Button>
<Button
size='small'
size='tiny'
loading={loading}
onClick={() => {
testChannels('all');
Expand All @@ -672,7 +672,7 @@ const ChannelsTable = () => {
{t('channel.buttons.test_all')}
</Button>
<Button
size='small'
size='tiny'
loading={loading}
onClick={() => {
testChannels('disabled');
Expand All @@ -682,7 +682,7 @@ const ChannelsTable = () => {
</Button>
<Popup
trigger={
<Button size='small' loading={loading}>
<Button size='tiny' loading={loading}>
{t('channel.buttons.delete_disabled')}
</Button>
}
Expand All @@ -691,7 +691,7 @@ const ChannelsTable = () => {
hoverable
>
<Button
size='small'
size='tiny'
loading={loading}
negative
onClick={deleteAllDisabledChannels}
Expand All @@ -703,17 +703,17 @@ const ChannelsTable = () => {
floated='right'
activePage={activePage}
onPageChange={onPaginationChange}
size='small'
size='tiny'
siblingRange={1}
totalPages={
Math.ceil(channels.length / ITEMS_PER_PAGE) +
(channels.length % ITEMS_PER_PAGE === 0 ? 1 : 0)
}
/>
<Button size='small' onClick={refresh} loading={loading}>
<Button size='tiny' onClick={refresh} loading={loading}>
{t('channel.buttons.refresh')}
</Button>
<Button size='small' onClick={toggleShowDetail}>
<Button size='tiny' onClick={toggleShowDetail}>
{showDetail
? t('channel.buttons.hide_detail')
: t('channel.buttons.show_detail')}
Expand Down
15 changes: 10 additions & 5 deletions web/default/src/components/RedemptionsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const RedemptionsTable = () => {
<Table.Cell>
<div>
<Button
size={'small'}
size={'tiny'}
positive
onClick={async () => {
if (await copy(redemption.key)) {
Expand All @@ -293,7 +293,7 @@ const RedemptionsTable = () => {
</Button>
<Popup
trigger={
<Button size='small' negative>
<Button size='tiny' negative>
{t('redemption.buttons.delete')}
</Button>
}
Expand All @@ -311,7 +311,7 @@ const RedemptionsTable = () => {
</Button>
</Popup>
<Button
size={'small'}
size={'tiny'}
disabled={redemption.status === 3} // used
onClick={() => {
manageRedemption(
Expand All @@ -326,7 +326,7 @@ const RedemptionsTable = () => {
: t('redemption.buttons.enable')}
</Button>
<Button
size={'small'}
size={'tiny'}
as={Link}
to={'/redemption/edit/' + redemption.id}
>
Expand All @@ -342,7 +342,12 @@ const RedemptionsTable = () => {
<Table.Footer>
<Table.Row>
<Table.HeaderCell colSpan='7'>
<Button size='small' as={Link} to='/redemption/add' loading={loading}>
<Button
size='small'
as={Link}
to='/redemption/add'
loading={loading}
>
{t('redemption.buttons.add')}
</Button>
<Button size='small' onClick={refresh} loading={loading}>
Expand Down
15 changes: 8 additions & 7 deletions web/default/src/components/TokensTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ const TokensTable = () => {
</Table.Cell>
<Table.Cell>
<div>
<Button.Group color='green' size={'small'}>
<Button.Group color='green' size={'mini'}>
<Button
size={'small'}
size={'mini'}
positive
onClick={async () => await onCopy('', token.key)}
>
Expand All @@ -430,9 +430,9 @@ const TokensTable = () => {
trigger={<></>}
/>
</Button.Group>{' '}
<Button.Group color='blue' size={'small'}>
<Button.Group color='blue' size={'mini'}>
<Button
size={'small'}
size={'mini'}
positive
onClick={() => onOpenLink('', token.key)}
>
Expand All @@ -447,7 +447,7 @@ const TokensTable = () => {
</Button.Group>{' '}
<Popup
trigger={
<Button size='small' negative>
<Button size='mini' negative>
{t('token.buttons.delete')}
</Button>
}
Expand All @@ -456,6 +456,7 @@ const TokensTable = () => {
hoverable
>
<Button
size={'mini'}
negative
onClick={() => {
manageToken(token.id, 'delete', idx);
Expand All @@ -465,7 +466,7 @@ const TokensTable = () => {
</Button>
</Popup>
<Button
size={'small'}
size={'mini'}
onClick={() => {
manageToken(
token.id,
Expand All @@ -479,7 +480,7 @@ const TokensTable = () => {
: t('token.buttons.enable')}
</Button>
<Button
size={'small'}
size={'mini'}
as={Link}
to={'/token/edit/' + token.id}
>
Expand Down
11 changes: 6 additions & 5 deletions web/default/src/components/UsersTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const UsersTable = () => {
<Table.Cell>
<div>
<Button
size={'small'}
size={'tiny'}
positive
onClick={() => {
manageUser(user.username, 'promote', idx);
Expand All @@ -302,7 +302,7 @@ const UsersTable = () => {
{t('user.buttons.promote')}
</Button>
<Button
size={'small'}
size={'tiny'}
color={'yellow'}
onClick={() => {
manageUser(user.username, 'demote', idx);
Expand All @@ -314,7 +314,7 @@ const UsersTable = () => {
<Popup
trigger={
<Button
size='small'
size='tiny'
negative
disabled={user.role === 100}
>
Expand All @@ -327,6 +327,7 @@ const UsersTable = () => {
>
<Button
negative
size={'tiny'}
onClick={() => {
manageUser(user.username, 'delete', idx);
}}
Expand All @@ -335,7 +336,7 @@ const UsersTable = () => {
</Button>
</Popup>
<Button
size={'small'}
size={'tiny'}
onClick={() => {
manageUser(
user.username,
Expand All @@ -350,7 +351,7 @@ const UsersTable = () => {
: t('user.buttons.enable')}
</Button>
<Button
size={'small'}
size={'tiny'}
as={Link}
to={'/user/edit/' + user.id}
>
Expand Down

0 comments on commit a01d769

Please sign in to comment.