mattermost-mobile/app/constants/snack_bar.ts
Avinash Lingaloo 83c2cfff97
MM-41532 Gekidou Snack Bars (#6181)
* styling mobile

wip

* styling tablet

wip

tablet portrait

* removed offSetY

* Update en.json

* corrections from reviews

* removed space

* changed location to sourceScreen in post.tsx

* adjust width

* update message to text

* adding PanGesture

adding PanGesture- wip

PanGesture- wip

* able to touch through on iOS

* using EphemeralStore and listeners to discard overlays

* snack positioning and touches

* PanGesture- wip

* PanGesture- fine tuning the animation

PanGesture- wip

* removed toast keyword

* checks for ongoing animation

* dismiss overlay on navigating away

* dismiss overlay on navigating away

* dismiss overlay on tabPress

* dismiss overlay on tabPress

* cancelled timers on panning start

* add entering layoutAnimation

* add exitingg layoutAnimation

* fix  layoutAnimation

* fix styling

* eslint fix

* style fix

* fix timer not stopping

* revert changes made to the ephemeral store

* bumping the toast vertically by 4px

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-05-05 10:00:32 -04:00

51 lines
1.3 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {t} from '@i18n';
import keyMirror from '@utils/key_mirror';
export const SNACK_BAR_TYPE = keyMirror({
LINK_COPIED: null,
MESSAGE_COPIED: null,
FOLLOW_THREAD: null,
MUTE_CHANNEL: null,
FAILED_TO_SAVE_MESSAGE: null,
});
type SnackBarConfig = {
id: string;
defaultMessage: string;
iconName: string;
canUndo: boolean;
}
export const SNACK_BAR_CONFIG: Record<string, SnackBarConfig> = {
LINK_COPIED: {
id: t('snack.bar.link.copied'),
defaultMessage: 'Link copied to clipboard',
iconName: 'link-variant',
canUndo: false,
},
MESSAGE_COPIED: {
id: t('snack.bar.message.copied'),
defaultMessage: 'Text copied to clipboard',
iconName: 'content-copy',
canUndo: false,
},
FOLLOW_THREAD: {
id: t('snack.bar.follow.thread'),
defaultMessage: 'You\'re now following this thread',
iconName: 'message-check-outline',
canUndo: true,
},
MUTE_CHANNEL: {
id: t('snack.bar.mute.channel'),
defaultMessage: 'This channel was muted',
iconName: 'bell-off-outline',
canUndo: true,
},
};
export default {
SNACK_BAR_TYPE,
SNACK_BAR_CONFIG,
};