Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/containers/Avatar/__snapshots__/Avatar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ exports[`Story Snapshots: Children should match snapshot 1`] = `
[
{
"height": 24,
"textAlign": "center",
"textAlignVertical": "center",
"width": 24,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3923,7 +3923,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -4012,7 +4012,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -4164,7 +4164,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
"textAlign": "left",
},
{
"color": "#E4E7EA",
"color": "#C1C7D0",
},
]
}
Expand Down Expand Up @@ -4219,7 +4219,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down
24 changes: 12 additions & 12 deletions app/containers/List/__snapshots__/List.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6150,7 +6150,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -6202,7 +6202,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
},
undefined,
{
"color": "#E4E7EA",
"color": "#C1C7D0",
},
]
}
Expand Down Expand Up @@ -6257,7 +6257,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -6398,7 +6398,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -6450,7 +6450,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
},
undefined,
{
"color": "#E4E7EA",
"color": "#C1C7D0",
},
]
}
Expand Down Expand Up @@ -6505,7 +6505,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -6721,7 +6721,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -6773,7 +6773,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
},
undefined,
{
"color": "#E4E7EA",
"color": "#C1C7D0",
},
]
}
Expand Down Expand Up @@ -6828,7 +6828,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -6969,7 +6969,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down Expand Up @@ -7021,7 +7021,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
},
undefined,
{
"color": "#E4E7EA",
"color": "#C1C7D0",
},
]
}
Expand Down Expand Up @@ -7076,7 +7076,7 @@ exports[`Story Snapshots: WithDarkTheme should match snapshot 1`] = `
style={
[
{
"color": "#E4E7EA",
"color": "#C1C7D0",
"fontSize": 24,
},
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ exports[`Story Snapshots: ActiveCall should match snapshot 1`] = `
[
{
"height": 16,
"textAlign": "center",
"textAlignVertical": "center",
"width": 16,
},
Expand Down Expand Up @@ -228,7 +229,7 @@ exports[`Story Snapshots: ActiveCall should match snapshot 1`] = `
Bob Burnquist
<Text>
-
16448:41:15
16524:56:56
</Text>
Comment thread
diegolmello marked this conversation as resolved.
</Text>
</View>
Expand Down Expand Up @@ -536,6 +537,7 @@ exports[`Story Snapshots: Collapsed should match snapshot 1`] = `
[
{
"height": 16,
"textAlign": "center",
"textAlignVertical": "center",
"width": 16,
},
Expand Down Expand Up @@ -574,7 +576,7 @@ exports[`Story Snapshots: Collapsed should match snapshot 1`] = `
Bob Burnquist
<Text>
-
16448:41:15
16524:56:56
</Text>
</Text>
</View>
Expand Down Expand Up @@ -882,6 +884,7 @@ exports[`Story Snapshots: ConnectingCall should match snapshot 1`] = `
[
{
"height": 16,
"textAlign": "center",
"textAlignVertical": "center",
"width": 16,
},
Expand Down Expand Up @@ -1224,6 +1227,7 @@ exports[`Story Snapshots: Focused should match snapshot 1`] = `
[
{
"height": 16,
"textAlign": "center",
"textAlignVertical": "center",
"width": 16,
},
Expand Down Expand Up @@ -1262,7 +1266,7 @@ exports[`Story Snapshots: Focused should match snapshot 1`] = `
Bob Burnquist
<Text>
-
16448:41:15
16524:56:56
</Text>
</Text>
</View>
Expand Down Expand Up @@ -1590,6 +1594,7 @@ exports[`Story Snapshots: WithRemoteHeld should match snapshot 1`] = `
[
{
"height": 16,
"textAlign": "center",
"textAlignVertical": "center",
"width": 16,
},
Expand Down Expand Up @@ -1628,7 +1633,7 @@ exports[`Story Snapshots: WithRemoteHeld should match snapshot 1`] = `
Bob Burnquist
<Text>
-
16448:41:15
16524:56:56
</Text>
</Text>
</View>
Expand Down Expand Up @@ -1936,6 +1941,7 @@ exports[`Story Snapshots: WithRemoteMuted should match snapshot 1`] = `
[
{
"height": 16,
"textAlign": "center",
"textAlignVertical": "center",
"width": 16,
},
Expand Down Expand Up @@ -1974,7 +1980,7 @@ exports[`Story Snapshots: WithRemoteMuted should match snapshot 1`] = `
Bob Burnquist
<Text>
-
16448:41:15
16524:56:56
</Text>
</Text>
</View>
Expand Down
54 changes: 54 additions & 0 deletions app/containers/NewMediaCall/Container.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import BottomSheet from '@discord/bottom-sheet';

import { Container } from './Container';

const styles = StyleSheet.create({
root: {
flex: 1
},
placeholder: {
marginTop: 8,
padding: 12,
borderRadius: 6,
backgroundColor: '#efefef'
}
});

const PlaceholderChildren = () => (
<View style={styles.placeholder}>
<Text>Mock children placeholder</Text>
</View>
);

const BottomSheetWrapper = ({ children }: { children: React.ReactNode }) => (
<View style={styles.root}>
<BottomSheet
index={0}
snapPoints={['95%']}
handleComponent={null}
enablePanDownToClose={false}
backgroundStyle={{ backgroundColor: 'transparent' }}>
<View style={styles.root}>{children}</View>
</BottomSheet>
</View>
);

export default {
title: 'NewMediaCall/Container',
component: Container,
decorators: [
(Story: React.ComponentType) => (
<BottomSheetWrapper>
<Story />
</BottomSheetWrapper>
)
]
};

export const Default = () => (
<Container>
<PlaceholderChildren />
</Container>
);
18 changes: 18 additions & 0 deletions app/containers/NewMediaCall/Container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';

import { useTheme } from '../../theme';

export const Container = ({ children }: { children: React.ReactElement[] | React.ReactElement }) => {
const { colors } = useTheme();

return <View style={[styles.container, { backgroundColor: colors.surfaceLight }]}>{children}</View>;
};

const styles = StyleSheet.create({
container: {
flex: 1,
paddingHorizontal: 16,
paddingTop: 16
}
});
46 changes: 46 additions & 0 deletions app/containers/NewMediaCall/CreateCall.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';

import * as ActionSheetModule from '../ActionSheet';
import { mediaSessionInstance } from '../../lib/services/voip/MediaSessionInstance';
import { usePeerAutocompleteStore } from '../../lib/services/voip/usePeerAutocompleteStore';
import { CreateCall } from './CreateCall';
import type { TPeerItem } from '../../lib/services/voip/getPeerAutocompleteOptions';

const mediaSession = mediaSessionInstance as unknown as { startCall: (...args: unknown[]) => void };
mediaSession.startCall = () => {};

try {
Object.defineProperty(ActionSheetModule, 'hideActionSheetRef', {
value: () => {},
writable: true
});
} catch {
// noop: in environments where export is not re-definable,
// the original hideActionSheetRef is already safe with optional chaining.
}

const setStoreState = (selectedPeer: ReturnType<typeof usePeerAutocompleteStore.getState>['selectedPeer']) => {
usePeerAutocompleteStore.setState({ selectedPeer });
};

const userPeer: TPeerItem = {
type: 'user',
value: 'user-1',
label: 'Alice Johnson',
username: 'alice.johnson'
};

export default {
title: 'NewMediaCall/CreateCall',
component: CreateCall
};

export const Disabled = () => {
setStoreState(null);
return <CreateCall />;
};

export const Enabled = () => {
setStoreState(userPeer);
return <CreateCall />;
};
Loading
Loading