mirror of
https://github.com/balzack/databag.git
synced 2025-05-05 07:55:15 +00:00
rendering members in admin
This commit is contained in:
parent
ee3606c573
commit
8a2d57f089
@ -171,8 +171,8 @@ export const en = {
|
|||||||
areSure: 'Are you sure you want to delete the account?',
|
areSure: 'Are you sure you want to delete the account?',
|
||||||
|
|
||||||
addingTitle: 'Adding Account',
|
addingTitle: 'Adding Account',
|
||||||
addingLink: 'Use the following link can be used to create an account',
|
addingLink: 'Use the following link to create an account',
|
||||||
addingToken: 'Use the following token can be used to create an account from the login screen',
|
addingToken: 'Use the following token to create an account from the login screen',
|
||||||
accessingTitle: 'Accessing Account',
|
accessingTitle: 'Accessing Account',
|
||||||
accessingLink: 'Use the following link to access the specified account',
|
accessingLink: 'Use the following link to access the specified account',
|
||||||
accessingToken: 'Use the following token to access the specified account from the login screen',
|
accessingToken: 'Use the following token to access the specified account from the login screen',
|
||||||
|
@ -1,12 +1,33 @@
|
|||||||
.accounts {
|
.accounts {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
.member {
|
||||||
|
height: 40px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
border-bottom: 1px solid var(--mantine-color-text-8);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action {
|
||||||
|
margin-left: 8px;
|
||||||
|
margin-right: 8px;
|
||||||
|
padding-left: 2px;
|
||||||
|
padding-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 650px;
|
max-width: 800px;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
height: 48px;
|
height: 48px;
|
||||||
@ -15,6 +36,9 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
border-bottom: 2px solid var(--mantine-color-text-8);
|
||||||
|
|
||||||
.leftTitle {
|
.leftTitle {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
@ -29,15 +53,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
padding-left: 16px;
|
|
||||||
padding-right: 16px;
|
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
.area {
|
.area {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.members {
|
||||||
|
flex-grow: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow: auto;
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.line {
|
.line {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,53 @@
|
|||||||
import classes from './Accounts.module.css'
|
import classes from './Accounts.module.css'
|
||||||
import { useAccounts } from './useAccounts.hook'
|
import { useAccounts } from './useAccounts.hook'
|
||||||
import { Modal, Divider, Text, ActionIcon } from '@mantine/core'
|
import { Modal, Divider, Text, ActionIcon } from '@mantine/core'
|
||||||
|
import { IconUserPlus, IconReload, IconSettings, IconLockOpen2, IconUserCancel, IconTrash } from '@tabler/icons-react'
|
||||||
|
import { Card } from '../card/Card'
|
||||||
|
|
||||||
export function Accounts({ openSetup }: { openSetup: ()=>void }) {
|
export function Accounts({ openSetup }: { openSetup: ()=>void }) {
|
||||||
const { state, actions } = useAccounts();
|
const { state, actions } = useAccounts();
|
||||||
|
|
||||||
|
const members = state.members.map((member, idx) => {
|
||||||
|
const options = [
|
||||||
|
<ActionIcon key="acess" className={classes.action} variant="light" onClick={actions.reload} loading={state.loading}><IconLockOpen2 /></ActionIcon>,
|
||||||
|
<ActionIcon key="block" className={classes.action} variant="light" onClick={actions.reload} loading={state.loading}><IconUserCancel /></ActionIcon>,
|
||||||
|
<ActionIcon key="remove" className={classes.action} variant="light" onClick={actions.reload} loading={state.loading}><IconTrash /></ActionIcon>,
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card key={idx} className={classes.member} imageUrl={member.imageUrl} name={member.handle} handle={member.guid} select={()=>{}} actions={options} />
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.accounts}>
|
<div className={classes.accounts}>
|
||||||
<div className={classes.content}>
|
<div className={classes.content}>
|
||||||
<div className={classes.header}>
|
<div className={classes.header}>
|
||||||
|
{ state.layout !== 'large' && (
|
||||||
|
<ActionIcon className={classes.action} variant="light" onClick={actions.reload} loading={state.loading}>
|
||||||
|
<IconReload />
|
||||||
|
</ActionIcon>
|
||||||
|
)}
|
||||||
<div className={state.layout === 'large' ? classes.leftTitle : classes.centerTitle}>
|
<div className={state.layout === 'large' ? classes.leftTitle : classes.centerTitle}>
|
||||||
<Text className={classes.title}>{ state.strings.accounts }</Text>
|
<Text className={classes.title}>{ state.strings.accounts }</Text>
|
||||||
</div>
|
</div>
|
||||||
|
{ state.layout === 'large' && (
|
||||||
|
<ActionIcon className={classes.action} variant="light" onClick={actions.reload} loading={state.loading}>
|
||||||
|
<IconReload />
|
||||||
|
</ActionIcon>
|
||||||
|
)}
|
||||||
|
<ActionIcon className={classes.action} variant="light" onClick={()=>{}}>
|
||||||
|
<IconUserPlus />
|
||||||
|
</ActionIcon>
|
||||||
|
{ state.layout === 'large' && (
|
||||||
|
<ActionIcon className={classes.action} variant="light" onClick={openSetup}>
|
||||||
|
<IconSettings />
|
||||||
|
</ActionIcon>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className={classes.members}>
|
||||||
|
{ members }
|
||||||
</div>
|
</div>
|
||||||
<Divider className={classes.line} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
min-width: 0;
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
|
@ -169,8 +169,8 @@ export const en = {
|
|||||||
areSure: 'Are you sure you want to delete the account?',
|
areSure: 'Are you sure you want to delete the account?',
|
||||||
|
|
||||||
addingTitle: 'Adding Account',
|
addingTitle: 'Adding Account',
|
||||||
addingLink: 'Use the following link can be used to create an account',
|
addingLink: 'Use the following link to create an account',
|
||||||
addingToken: 'Use the following token can be used to create an account from the login screen',
|
addingToken: 'Use the following token to create an account from the login screen',
|
||||||
accessingTitle: 'Accessing Account',
|
accessingTitle: 'Accessing Account',
|
||||||
accessingLink: 'Use the following link to access the specified account',
|
accessingLink: 'Use the following link to access the specified account',
|
||||||
accessingToken: 'Use the following token to access the specified account from the login screen',
|
accessingToken: 'Use the following token to access the specified account from the login screen',
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
padding-left: 16px;
|
||||||
|
padding-right: 16px;
|
||||||
|
|
||||||
.centerTitle {
|
.centerTitle {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import classes from './Setup.module.css'
|
import classes from './Setup.module.css'
|
||||||
import { useSetup } from './useSetup.hook'
|
import { useSetup } from './useSetup.hook'
|
||||||
import { Modal, Divider, Text, ActionIcon } from '@mantine/core'
|
import { Loader, Modal, Divider, Text, ActionIcon } from '@mantine/core'
|
||||||
|
|
||||||
export function Setup() {
|
export function Setup() {
|
||||||
const { state, actions } = useSetup();
|
const { state, actions } = useSetup();
|
||||||
@ -9,9 +9,15 @@ export function Setup() {
|
|||||||
<div className={classes.accounts}>
|
<div className={classes.accounts}>
|
||||||
<div className={classes.content}>
|
<div className={classes.content}>
|
||||||
<div className={classes.header}>
|
<div className={classes.header}>
|
||||||
|
{ state.loading && (
|
||||||
|
<Loader size={18} />
|
||||||
|
)}
|
||||||
<div className={classes.centerTitle}>
|
<div className={classes.centerTitle}>
|
||||||
<Text className={classes.title}>{ state.strings.setup }</Text>
|
<Text className={classes.title}>{ state.strings.setup }</Text>
|
||||||
</div>
|
</div>
|
||||||
|
{ state.updating && (
|
||||||
|
<Loader size={18} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Divider className={classes.line} />
|
<Divider className={classes.line} />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user