Skip to content

Commit f33b02f

Browse files
committed
Merge branch 'develop' into chore.develop-into-voip
# Conflicts: # CLAUDE.md # android/app/build.gradle # android/app/src/main/java/chat/rocket/reactnative/MainApplication.kt # app/containers/Header/components/HeaderButton/__snapshots__/HeaderButtons.test.tsx.snap # app/containers/UIKit/__snapshots__/UiKitMessage.test.tsx.snap # app/sagas/login.js # app/views/DiscussionsView/__snapshots__/Item.test.tsx.snap # app/views/RoomView/LoadMore/__snapshots__/LoadMore.test.tsx.snap # app/views/ThreadMessagesView/__snapshots__/Item.test.tsx.snap # ios/Podfile.lock # ios/RocketChatRN.xcodeproj/project.pbxproj # package.json # yarn.lock
2 parents 7b7866d + cb0feee commit f33b02f

10 files changed

Lines changed: 3953 additions & 5601 deletions

File tree

app/containers/Header/components/HeaderButton/__snapshots__/HeaderButtons.test.tsx.snap

Lines changed: 424 additions & 511 deletions
Large diffs are not rendered by default.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import React from 'react';
2+
3+
import { ThemeContext, type TSupportedThemes } from '../../theme';
4+
import { themes } from '../../lib/constants/colors';
5+
import NotifierComponent from './NotifierComponent';
6+
import { SubscriptionType } from '../../definitions';
7+
import {
8+
BASE_ROW_HEIGHT,
9+
BASE_ROW_HEIGHT_CONDENSED,
10+
ResponsiveLayoutContext
11+
} from '../../lib/hooks/useResponsiveLayout/useResponsiveLayout';
12+
13+
const responsiveLayoutProviderValue = {
14+
fontScale: 1,
15+
fontScaleLimited: 1,
16+
isLargeFontScale: false,
17+
rowHeight: BASE_ROW_HEIGHT,
18+
rowHeightCondensed: BASE_ROW_HEIGHT_CONDENSED,
19+
width: 300,
20+
height: 800
21+
};
22+
23+
const baseNotification = {
24+
text: 'Hey! How are you doing?',
25+
payload: {
26+
_id: '1',
27+
rid: 'rid-1',
28+
name: 'general',
29+
sender: { username: 'rocket.cat' },
30+
type: SubscriptionType.CHANNEL
31+
},
32+
title: 'general',
33+
avatar: 'rocket.cat'
34+
};
35+
36+
const Wrapper = ({ children, theme = 'light' }: { children: React.ReactNode; theme?: TSupportedThemes }) => (
37+
<ThemeContext.Provider value={{ theme, colors: themes[theme] }}>
38+
<ResponsiveLayoutContext.Provider value={responsiveLayoutProviderValue}>{children}</ResponsiveLayoutContext.Provider>
39+
</ThemeContext.Provider>
40+
);
41+
42+
export default {
43+
title: 'InAppNotification'
44+
};
45+
46+
export const DirectMessage = () => (
47+
<Wrapper>
48+
<NotifierComponent
49+
notification={{
50+
...baseNotification,
51+
payload: {
52+
...baseNotification.payload,
53+
type: SubscriptionType.DIRECT,
54+
sender: { username: 'diego.mello' }
55+
},
56+
title: 'diego.mello',
57+
avatar: 'diego.mello'
58+
}}
59+
/>
60+
</Wrapper>
61+
);
62+
export const ChannelMessage = () => (
63+
<Wrapper>
64+
<NotifierComponent notification={baseNotification} />
65+
</Wrapper>
66+
);
67+
export const WithDarkTheme = () => (
68+
<Wrapper theme='dark'>
69+
<NotifierComponent notification={baseNotification} />
70+
</Wrapper>
71+
);
72+
export const WithBlackTheme = () => (
73+
<Wrapper theme='black'>
74+
<NotifierComponent notification={baseNotification} />
75+
</Wrapper>
76+
);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { generateSnapshots } from '../../../.rnstorybook/generateSnapshots';
2+
import * as stories from './NotifierComponent.stories';
3+
4+
generateSnapshots(stories);

0 commit comments

Comments
 (0)