-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
154 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as React from 'react' | ||
import { View } from 'react-native' | ||
import { cacheStyles } from 'react-native-patina' | ||
|
||
import { getThemedIconUri } from '../../util/CdnUris' | ||
import { Theme, useTheme } from '../services/ThemeContext' | ||
import { NotificationCard } from './NotificationCard' | ||
|
||
interface Props { | ||
message: string | ||
title: string | ||
type: 'warning' | 'info' | ||
isComplete: boolean | ||
iconUri?: string | ||
|
||
onPress: () => void | Promise<void> | ||
} | ||
|
||
export const NotificationCenterCard = (props: Props) => { | ||
const theme = useTheme() | ||
const styles = getStyles(theme) | ||
|
||
const { title, type, message, isComplete, onPress } = props | ||
const { iconUri = type === 'warning' ? getThemedIconUri(theme, 'notifications/icon-warning') : getThemedIconUri(theme, 'notifications/icon-info') } = props | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<View style={[styles.dot, isComplete ? styles.noDot : null]} /> | ||
<NotificationCard message={message} title={title} type={type} iconUri={iconUri} onPress={onPress} /> | ||
</View> | ||
) | ||
} | ||
|
||
const getStyles = cacheStyles((theme: Theme) => ({ | ||
container: { | ||
flexDirection: 'row', | ||
flexShrink: 1, | ||
flexGrow: 1 | ||
}, | ||
dot: { | ||
width: theme.rem(0.75), | ||
height: theme.rem(0.75), | ||
backgroundColor: 'red' | ||
}, | ||
noDot: { | ||
backgroundColor: 'transparent' | ||
} | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as React from 'react' | ||
|
||
import { getDeviceSettings } from '../../actions/DeviceSettingsActions' | ||
import { getLocalAccountSettings } from '../../actions/LocalSettingsActions' | ||
import { useAsyncEffect } from '../../hooks/useAsyncEffect' | ||
import { lstrings } from '../../locales/strings' | ||
import { useSelector } from '../../types/reactRedux' | ||
import { EdgeAppSceneProps } from '../../types/routerTypes' | ||
import { DeviceNotifInfo } from '../../types/types' | ||
import { SceneWrapper } from '../common/SceneWrapper' | ||
import { SectionHeader } from '../common/SectionHeader' | ||
import { useTheme } from '../services/ThemeContext' | ||
|
||
interface Props extends EdgeAppSceneProps<'notificationCenter'> {} | ||
|
||
export const NotificationCenterScene = (props: Props) => { | ||
const { navigation } = props | ||
const theme = useTheme() | ||
const { deviceNotifState } = getDeviceSettings() | ||
const accountNotifDismissInfo = getLocalAccountSettings().accountNotifDismissInfo | ||
|
||
const pinnedNotifInfos = Object.values(deviceNotifState).filter(deviceNotifInfo => deviceNotifInfo.isPriority) | ||
const otherNotifInfos = Object.values(deviceNotifState).filter(deviceNotifInfo => !deviceNotifInfo.isPriority) | ||
|
||
return ( | ||
<SceneWrapper> | ||
<SectionHeader leftTitle={lstrings.pinned_notifications} /> | ||
<></> | ||
<SectionHeader leftTitle={lstrings.other_notifications} /> | ||
</SceneWrapper> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters