fix(PickerCategory): sort roles by position

This commit is contained in:
41666 2020-12-18 21:02:41 -05:00
parent 51ae64e664
commit 4159622226

View file

@ -5,6 +5,7 @@ import {
Role as RPCRole, Role as RPCRole,
RoleSafety, RoleSafety,
} from 'roleypoly/common/types'; } from 'roleypoly/common/types';
import { sortBy } from 'roleypoly/common/utils/sortBy';
import { Role } from 'roleypoly/design-system/atoms/role'; import { Role } from 'roleypoly/design-system/atoms/role';
import { AmbientLarge, LargeText } from 'roleypoly/design-system/atoms/typography'; import { AmbientLarge, LargeText } from 'roleypoly/design-system/atoms/typography';
import styled from 'styled-components'; import styled from 'styled-components';
@ -50,7 +51,7 @@ export const PickerCategory = (props: CategoryProps) => (
)} )}
</Head> </Head>
<Category> <Category>
{props.roles.map((role, idx) => ( {sortBy(props.roles, 'position').map((role, idx) => (
<Container key={idx}> <Container key={idx}>
<Role <Role
role={role} role={role}