mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Disable actions in leaderboard entries table
This commit is contained in:
@@ -21,9 +21,14 @@ import { type LeaderboardDisplayData } from '../../Utils/GDevelopServices/Play';
|
||||
type Props = {|
|
||||
entries: ?Array<LeaderboardDisplayData>,
|
||||
onDeleteEntry: (entryId: string) => Promise<void>,
|
||||
disableActions: boolean,
|
||||
|};
|
||||
|
||||
const LeaderboardEntriesTable = ({ entries, onDeleteEntry }: Props) => {
|
||||
const LeaderboardEntriesTable = ({
|
||||
entries,
|
||||
onDeleteEntry,
|
||||
disableActions,
|
||||
}: Props) => {
|
||||
if (!entries) return <PlaceholderLoader />;
|
||||
|
||||
return (
|
||||
@@ -73,7 +78,10 @@ const LeaderboardEntriesTable = ({ entries, onDeleteEntry }: Props) => {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Tooltip title={'Remove entry'}>
|
||||
<IconButton onClick={() => onDeleteEntry(entry.id)}>
|
||||
<IconButton
|
||||
onClick={() => onDeleteEntry(entry.id)}
|
||||
disabled={disableActions}
|
||||
>
|
||||
<DeleteOutline size={20} />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
@@ -500,6 +500,7 @@ const LeaderboardAdmin = ({ onLoading }: Props) => {
|
||||
<LeaderboardEntriesTable
|
||||
entries={entries}
|
||||
onDeleteEntry={entryId => _deleteEntry(i18n, entryId)}
|
||||
disableActions={isRequestPending || isEditingName}
|
||||
/>
|
||||
</div>
|
||||
</ResponsiveLineStackLayout>
|
||||
|
Reference in New Issue
Block a user