mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-15 00:59:09 +00:00
parent
175144cc7a
commit
dec4aa9619
4 changed files with 4 additions and 32 deletions
|
@ -2,10 +2,10 @@ import { Popover } from '@roleypoly/design-system/atoms/popover';
|
|||
import { Role } from '@roleypoly/design-system/atoms/role';
|
||||
import { RoleSearch } from '@roleypoly/design-system/molecules/role-search';
|
||||
import { Role as RoleT } from '@roleypoly/types';
|
||||
import { sortBy, uniq } from 'lodash';
|
||||
import React from 'react';
|
||||
import { GoPlus } from 'react-icons/go';
|
||||
import { AddRoleButton, EditableRoleListStyled } from './EditableRoleList.styled';
|
||||
import { sortByReverse } from '@roleypoly/misc-utils/sortBy';
|
||||
|
||||
type Props = {
|
||||
roles: RoleT[];
|
||||
|
@ -36,7 +36,7 @@ export const EditableRoleList = (props: Props) => {
|
|||
<EditableRoleListStyled>
|
||||
{props.selectedRoles.length !== 0 ? (
|
||||
<>
|
||||
{sortByReverse(
|
||||
{sortBy(
|
||||
props.roles.filter((r) => props.selectedRoles.includes(r.id)),
|
||||
'position'
|
||||
).map((role) => (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Role } from '@roleypoly/design-system/atoms/role';
|
||||
import { AmbientLarge, LargeText } from '@roleypoly/design-system/atoms/typography';
|
||||
import { sortByReverse } from '@roleypoly/misc-utils/sortBy';
|
||||
import { sortBy } from '@roleypoly/misc-utils/sortBy';
|
||||
import { Category as RPCCategory, Role as RPCRole, RoleSafety } from '@roleypoly/types';
|
||||
import * as React from 'react';
|
||||
import ReactTooltip from 'react-tooltip';
|
||||
|
@ -47,7 +47,7 @@ export const PickerCategory = (props: CategoryProps) => (
|
|||
)}
|
||||
</Head>
|
||||
<Category>
|
||||
{sortByReverse(props.roles, 'position').map((role, idx) => (
|
||||
{sortBy(props.roles, 'position').map((role, idx) => (
|
||||
<Container key={idx}>
|
||||
<Role
|
||||
role={role}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue