Skip to content

Commit 37d811a

Browse files
authored
Merge branch 'develop' into issue-#3020
2 parents cc2d65d + 6cac275 commit 37d811a

File tree

106 files changed

+3225
-3326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3225
-3326
lines changed

.storybook/decorator-theme.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { upperFirst } from 'lodash';
2+
import React from 'react';
3+
import styled, { ThemeProvider } from 'styled-components';
4+
import theme, { prop } from '../client/theme';
5+
6+
const PreviewArea = styled.div`
7+
background: ${prop('backgroundColor')};
8+
flex-grow: 1;
9+
padding: 2rem;
10+
& > h4 {
11+
margin-top: 0;
12+
color: ${prop('primaryTextColor')};
13+
}
14+
`;
15+
16+
const themeKeys = Object.keys(theme);
17+
18+
export const withThemeProvider = (Story, context) => {
19+
const setting = context.globals.theme;
20+
if (setting === 'all') {
21+
return (
22+
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
23+
{Object.keys(theme).map((themeName) => (
24+
<ThemeProvider theme={theme[themeName]} key={themeName}>
25+
<PreviewArea className={themeName}>
26+
<h4>{upperFirst(themeName)}</h4>
27+
<Story />
28+
</PreviewArea>
29+
</ThemeProvider>
30+
))}
31+
</div>
32+
);
33+
} else {
34+
const themeName = setting;
35+
return (
36+
<ThemeProvider theme={theme[themeName]}>
37+
<PreviewArea className={themeName}>
38+
<Story />
39+
</PreviewArea>
40+
</ThemeProvider>
41+
);
42+
}
43+
};
44+
45+
export const themeToolbarItem = {
46+
description: 'Global theme for components',
47+
defaultValue: 'all',
48+
toolbar: {
49+
title: 'Theme',
50+
icon: 'mirror',
51+
items: [...themeKeys, 'all']
52+
}
53+
};

.storybook/preview.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React from 'react';
22
import { Provider } from 'react-redux';
33
import { MemoryRouter } from 'react-router';
44

5-
import ThemeProvider from '../client/modules/App/components/ThemeProvider';
65
import configureStore from '../client/store';
76
import '../client/i18n-test';
87
import '../client/styles/storybook.css'
8+
import { withThemeProvider, themeToolbarItem } from './decorator-theme';
99

1010
const initialState = window.__INITIAL_STATE__;
1111

@@ -21,5 +21,9 @@ export const decorators = [
2121
</MemoryRouter>
2222
</Provider>
2323
),
24-
]
24+
withThemeProvider
25+
];
2526

27+
export const globalTypes = {
28+
theme: themeToolbarItem
29+
};

Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ FROM base as development
1010
ENV NODE_ENV development
1111
COPY package.json package-lock.json ./
1212
RUN npm install
13-
RUN npm rebuild node-sass
1413
COPY .babelrc index.js nodemon.json ./
1514
COPY ./webpack ./webpack
1615
COPY client ./client
@@ -27,6 +26,5 @@ FROM base as production
2726
ENV NODE_ENV=production
2827
COPY package.json package-lock.json index.js ./
2928
RUN npm install --production
30-
RUN npm rebuild node-sass
3129
COPY --from=build $APP_HOME/dist ./dist
3230
CMD ["npm", "run", "start:prod"]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Issues and Pull Requests categorized under the PATCH or MINOR Release Milestones
3838

3939
We will aim to deploy on a 1-2 month basis. Here are some dates we’re working towards:
4040

41-
2.11.0 MINOR Release: By January 10, 2023
41+
2.12.0 MINOR Release: By February 27, 2024
4242

4343
[You can read more about Semantic Versioning and the differences between a MINOR and PATCH release](https://semver.org/).
4444

client/common/Button.jsx

+5-59
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const displays = {
2121
const StyledButton = styled.button`
2222
&&& {
2323
font-weight: bold;
24-
display: flex;
24+
display: ${({ display }) =>
25+
display === displays.inline ? 'inline-flex' : 'flex'};
2526
justify-content: center;
2627
align-items: center;
2728
@@ -107,57 +108,6 @@ const StyledInlineButton = styled.button`
107108
}
108109
`;
109110

110-
const StyledIconButton = styled.button`
111-
&&& {
112-
display: flex;
113-
justify-content: center;
114-
align-items: center;
115-
116-
width: ${remSize(32)}px;
117-
height: ${remSize(32)}px;
118-
text-decoration: none;
119-
120-
color: ${({ kind }) => prop(`Button.${kind}.default.foreground`)};
121-
background-color: ${({ kind }) => prop(`Button.${kind}.hover.background`)};
122-
cursor: pointer;
123-
border: 1px solid transparent;
124-
border-radius: 50%;
125-
padding: ${remSize(8)} ${remSize(25)};
126-
line-height: 1;
127-
128-
&:hover:not(:disabled) {
129-
color: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
130-
background-color: ${({ kind }) =>
131-
prop(`Button.${kind}.hover.background`)};
132-
133-
svg * {
134-
fill: ${({ kind }) => prop(`Button.${kind}.hover.foreground`)};
135-
}
136-
}
137-
138-
&:active:not(:disabled) {
139-
color: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
140-
background-color: ${({ kind }) =>
141-
prop(`Button.${kind}.active.background`)};
142-
143-
svg * {
144-
fill: ${({ kind }) => prop(`Button.${kind}.active.foreground`)};
145-
}
146-
}
147-
148-
&:disabled {
149-
color: ${({ kind }) => prop(`Button.${kind}.disabled.foreground`)};
150-
background-color: ${({ kind }) =>
151-
prop(`Button.${kind}.disabled.background`)};
152-
cursor: not-allowed;
153-
}
154-
155-
> * + * {
156-
margin-left: ${remSize(8)};
157-
}
158-
}
159-
`;
160-
161111
/**
162112
* A Button performs an primary action
163113
*/
@@ -184,12 +134,8 @@ const Button = ({
184134
);
185135
let StyledComponent = StyledButton;
186136

187-
if (display === displays.inline) {
188-
StyledComponent = StyledInlineButton;
189-
}
190-
191137
if (iconOnly) {
192-
StyledComponent = StyledIconButton;
138+
StyledComponent = StyledInlineButton;
193139
}
194140

195141
if (href) {
@@ -265,7 +211,7 @@ Button.propTypes = {
265211
/**
266212
* The display type of the button—inline or block
267213
*/
268-
display: PropTypes.string,
214+
display: PropTypes.oneOf(Object.values(displays)),
269215
/**
270216
* SVG icon to place after child content
271217
*/
@@ -286,7 +232,7 @@ Button.propTypes = {
286232
* Specifying an href will use an <a> to link to the URL
287233
*/
288234
href: PropTypes.string,
289-
/*
235+
/**
290236
* An ARIA Label used for accessibility
291237
*/
292238
'aria-label': PropTypes.string,

client/common/IconButton.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const IconButton = (props) => {
1919
return (
2020
<ButtonWrapper
2121
iconBefore={icon && <Icon />}
22+
iconOnly
2223
display={Button.displays.inline}
2324
focusable="false"
2425
{...otherProps}

client/constants.js

-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ export const SHOW_EDITOR_OPTIONS = 'SHOW_EDITOR_OPTIONS';
9090
export const CLOSE_EDITOR_OPTIONS = 'CLOSE_EDITOR_OPTIONS';
9191
export const SHOW_KEYBOARD_SHORTCUT_MODAL = 'SHOW_KEYBOARD_SHORTCUT_MODAL';
9292
export const CLOSE_KEYBOARD_SHORTCUT_MODAL = 'CLOSE_KEYBOARD_SHORTCUT_MODAL';
93-
export const SHOW_FUNDRAISER_MODAL = 'SHOW_FUNDRAISER_MODAL';
94-
export const CLOSE_FUNDRAISER_MODAL = 'CLOSE_FUNDRAISER_MODAL';
9593
export const SHOW_TOAST = 'SHOW_TOAST';
9694
export const HIDE_TOAST = 'HIDE_TOAST';
9795
export const SET_TOAST_TEXT = 'SET_TOAST_TEXT';
@@ -132,8 +130,6 @@ export const CLEAR_PERSISTED_STATE = 'CLEAR_PERSISTED_STATE';
132130

133131
export const HIDE_RUNTIME_ERROR_WARNING = 'HIDE_RUNTIME_ERROR_WARNING';
134132
export const SHOW_RUNTIME_ERROR_WARNING = 'SHOW_RUNTIME_ERROR_WARNING';
135-
export const SET_ASSETS = 'SET_ASSETS';
136-
export const DELETE_ASSET = 'DELETE_ASSET';
137133

138134
export const TOGGLE_DIRECTION = 'TOGGLE_DIRECTION';
139135
export const SET_SORTING = 'SET_SORTING';

client/i18n.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import {
1717
zhTW,
1818
uk,
1919
sv,
20-
tr
20+
tr,
21+
enIN
2122
} from 'date-fns/locale';
2223

2324
const fallbackLng = ['en-US'];
@@ -37,12 +38,13 @@ export const availableLanguages = [
3738
'uk-UA',
3839
'zh-CN',
3940
'zh-TW',
40-
'tr'
41+
'tr',
42+
'ur'
4143
];
4244

4345
export function languageKeyToLabel(lang) {
4446
const languageMap = {
45-
be: 'Bengali',
47+
be: 'বাংলা',
4648
de: 'Deutsch',
4749
'en-US': 'English',
4850
'es-419': 'Español',
@@ -56,7 +58,8 @@ export function languageKeyToLabel(lang) {
5658
'uk-UA': 'Українська',
5759
'zh-CN': '简体中文',
5860
'zh-TW': '正體中文',
59-
tr: 'Türkçe'
61+
tr: 'Türkçe',
62+
ur: 'اردو'
6063
};
6164
return languageMap[lang];
6265
}
@@ -77,7 +80,8 @@ export function languageKeyToDateLocale(lang) {
7780
'uk-UA': uk,
7881
'zh-CN': zhCN,
7982
'zh-TW': zhTW,
80-
tr
83+
tr,
84+
ur: enIN
8185
};
8286
return languageMap[lang];
8387
}

0 commit comments

Comments
 (0)