Add support for changing account password

This commit is contained in:
Dane Everitt 2019-06-22 23:45:09 -07:00
parent d43b7ea5bc
commit 438f1b06b9
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 38 additions and 13 deletions

View file

@ -4,14 +4,20 @@ import { State, useStoreState } from 'easy-peasy';
import { ApplicationState } from '@/state/types';
type Props = Readonly<{
byKey?: string;
spacerClass?: string;
withBottomSpace?: boolean;
}>;
export default ({ withBottomSpace, spacerClass }: Props) => {
export default ({ withBottomSpace, spacerClass, byKey }: Props) => {
const flashes = useStoreState((state: State<ApplicationState>) => state.flashes.items);
if (flashes.length === 0) {
let filtered = flashes;
if (byKey) {
filtered = flashes.filter(flash => flash.key === byKey);
}
if (filtered.length === 0) {
return null;
}
@ -19,7 +25,7 @@ export default ({ withBottomSpace, spacerClass }: Props) => {
return (
<div className={withBottomSpace === false ? undefined : 'mb-2'}>
{
flashes.map((flash, index) => (
filtered.map((flash, index) => (
<React.Fragment key={flash.id || flash.type + flash.message}>
{index > 0 && <div className={spacerClass || 'mt-2'}></div>}
<MessageBox type={flash.type} title={flash.title}>