aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/ui/Alert.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/components/ui/Alert.tsx')
-rw-r--r--server/sonar-web/src/main/js/components/ui/Alert.tsx27
1 files changed, 14 insertions, 13 deletions
diff --git a/server/sonar-web/src/main/js/components/ui/Alert.tsx b/server/sonar-web/src/main/js/components/ui/Alert.tsx
index abd339da10d..2a63bad32ad 100644
--- a/server/sonar-web/src/main/js/components/ui/Alert.tsx
+++ b/server/sonar-web/src/main/js/components/ui/Alert.tsx
@@ -17,14 +17,16 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { css } from '@emotion/core';
+import styled from '@emotion/styled';
import * as classNames from 'classnames';
import * as React from 'react';
+import { colors, sizes } from '../../app/theme';
import { translate } from '../../helpers/l10n';
import AlertErrorIcon from '../icons/AlertErrorIcon';
import AlertSuccessIcon from '../icons/AlertSuccessIcon';
import AlertWarnIcon from '../icons/AlertWarnIcon';
import InfoIcon from '../icons/InfoIcon';
-import { css, styled, Theme, themeColor, ThemedProps, themeSize, useTheme } from '../theme';
import DeferredSpinner from './DeferredSpinner';
type AlertDisplay = 'banner' | 'inline' | 'block';
@@ -47,7 +49,7 @@ const StyledAlertIcon = styled.div<{ isBanner: boolean; variantInfo: AlertVarian
display: flex;
justify-content: center;
align-items: center;
- width: calc(${({ isBanner }) => (isBanner ? 2 : 4)} * ${themeSize('gridSize')});
+ width: calc(${({ isBanner }) => (isBanner ? 2 : 4)} * ${sizes.gridSize});
border-right: ${({ isBanner }) => (!isBanner ? '1px solid' : 'none')};
border-color: ${({ variantInfo }) => variantInfo.borderColor};
`;
@@ -56,16 +58,16 @@ const StyledAlertContent = styled.div`
flex: 1 1 auto;
overflow: auto;
text-align: left;
- padding: ${themeSize('gridSize')} calc(2 * ${themeSize('gridSize')});
+ padding: ${sizes.gridSize} calc(2 * ${sizes.gridSize});
`;
-const alertInnerIsBannerMixin = ({ theme }: ThemedProps) => css`
- min-width: ${theme.sizes.minPageWidth};
- max-width: ${theme.sizes.maxPageWidth};
+const alertInnerIsBannerMixin = () => css`
+ min-width: ${sizes.minPageWidth};
+ max-width: ${sizes.maxPageWidth};
margin-left: auto;
margin-right: auto;
- padding-left: ${theme.sizes.pagePadding};
- padding-right: ${theme.sizes.pagePadding};
+ padding-left: ${sizes.pagePadding};
+ padding-right: ${sizes.pagePadding};
box-sizing: border-box;
`;
@@ -78,7 +80,7 @@ const StyledAlertInner = styled.div<{ isBanner: boolean }>`
const StyledAlert = styled.div<{ isInline: boolean; variantInfo: AlertVariantInformation }>`
border: 1px solid;
border-radius: 2px;
- margin-bottom: ${themeSize('gridSize')};
+ margin-bottom: ${sizes.gridSize};
border-color: ${({ variantInfo }) => variantInfo.borderColor};
background-color: ${({ variantInfo }) => variantInfo.backGroundColor};
color: ${({ variantInfo }) => variantInfo.color};
@@ -90,11 +92,11 @@ const StyledAlert = styled.div<{ isInline: boolean; variantInfo: AlertVariantInf
a,
.button-link {
- border-color: ${themeColor('darkBlue')};
+ border-color: ${colors.darkBlue};
}
`;
-function getAlertVariantInfo({ colors }: Theme, variant: AlertVariant): AlertVariantInformation {
+function getAlertVariantInfo(variant: AlertVariant): AlertVariantInformation {
const variantList: T.Dict<AlertVariantInformation> = {
error: {
icon: <AlertErrorIcon fill={colors.alertIconError} />,
@@ -132,11 +134,10 @@ function getAlertVariantInfo({ colors }: Theme, variant: AlertVariant): AlertVar
}
export function Alert(props: AlertProps & React.HTMLAttributes<HTMLDivElement>) {
- const theme = useTheme();
const { className, display, variant, ...domProps } = props;
const isInline = display === 'inline';
const isBanner = display === 'banner';
- const variantInfo = getAlertVariantInfo(theme, variant);
+ const variantInfo = getAlertVariantInfo(variant);
return (
<StyledAlert
4/stable30 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/apps/files_external/l10n/ja.js
blob: 17990d68e084bfdc4e1596f77da3cb8940131833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77