mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 09:39:09 +00:00
add an instant cache refresh to the editor
This commit is contained in:
parent
68b2b7323b
commit
0836d548b2
6 changed files with 66 additions and 11 deletions
|
@ -15,7 +15,14 @@ import { flatten, sortBy } from 'lodash';
|
|||
import React from 'react';
|
||||
import { DragDropContext, Draggable, Droppable, DropResult } from 'react-beautiful-dnd';
|
||||
import { CgReorder } from 'react-icons/cg';
|
||||
import { GoArrowDown, GoArrowUp, GoCheck, GoGrabber, GoPlus } from 'react-icons/go';
|
||||
import {
|
||||
GoArrowDown,
|
||||
GoArrowUp,
|
||||
GoCheck,
|
||||
GoGrabber,
|
||||
GoPlus,
|
||||
GoSync,
|
||||
} from 'react-icons/go';
|
||||
import { ulid } from 'ulidx';
|
||||
import {
|
||||
CategoryActions,
|
||||
|
@ -26,6 +33,7 @@ import {
|
|||
type Props = {
|
||||
guild: PresentableGuild;
|
||||
onChange: (categories: PresentableGuild['data']['categories']) => void;
|
||||
onRefreshCache?: () => void;
|
||||
};
|
||||
|
||||
const resetOrder = (categories: Category[]) =>
|
||||
|
@ -126,6 +134,9 @@ export const ServerCategoryEditor = (props: Props) => {
|
|||
<Button color="muted" size="small" onClick={() => setReorderMode(true)}>
|
||||
Change Order <CgReorder />
|
||||
</Button>
|
||||
<Button color="muted" size="small" onClick={props.onRefreshCache}>
|
||||
Refresh Roles <GoSync />
|
||||
</Button>
|
||||
</CategoryActions>
|
||||
{props.guild.data.categories.length > 0 ? (
|
||||
sortBy(props.guild.data.categories, ['position', 'id']).map((category, idx) => (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue