Skip to content

Commit 7e22d72

Browse files
lbogdanCompuIves
authored andcommitted
Made sandbox delete button and alert popup confirm button red. (codesandbox#767)
1 parent b95b545 commit 7e22d72

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

packages/app/src/app/components/Alert/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Alert({ title, body, onCancel, onDelete }) {
1212
<Button small block secondary onClick={onCancel}>
1313
Cancel
1414
</Button>
15-
<Button small block primary onClick={onDelete}>
15+
<Button small block danger onClick={onDelete}>
1616
Delete
1717
</Button>
1818
</Buttons>

packages/app/src/app/components/Button/elements.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import styled, { css, keyframes } from 'styled-components';
22
import Link from 'react-router-dom/Link';
33
import theme from 'common/theme';
44

5-
const getBackgroundColor = ({ disabled, red, secondary }) => {
5+
const getBackgroundColor = ({ disabled, red, secondary, danger }) => {
6+
if (danger) return `background-color: ${theme.dangerBackground()}`;
67
if (disabled) return `background: ${theme.background2.darken(0.1)()}`;
78
if (secondary) return `background: #3A4B5D`;
89
if (red)

packages/app/src/app/pages/Sandbox/Editor/Workspace/SandboxActions/elements.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ export const PatronMessage = styled.div`
1717
color: rgba(255, 255, 255, 0.6);
1818
font-size: 0.875rem;
1919
`;
20+
21+
export const CenteredText = styled.div`
22+
display: inline-flex;
23+
justify-content: center;
24+
align-items: center;
25+
flex-direction: row;
26+
27+
svg {
28+
opacity: 0.8;
29+
margin-right: 0.25rem;
30+
}
31+
`;

packages/app/src/app/pages/Sandbox/Editor/Workspace/SandboxActions/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
22
import { inject, observer } from 'mobx-react';
3+
import TrashIcon from 'react-icons/lib/fa/trash';
34

45
import Button from 'app/components/Button';
56
import { WorkspaceInputContainer, WorkspaceSubtitle } from '../elements';
67

7-
import { PrivacySelect, PatronMessage } from './elements';
8+
import { PrivacySelect, PatronMessage, CenteredText } from './elements';
89

910
function SandboxActions({ store, signals }) {
1011
const sandbox = store.editor.currentSandbox;
@@ -41,6 +42,7 @@ function SandboxActions({ store, signals }) {
4142
<Button
4243
block
4344
small
45+
danger
4446
style={{
4547
margin: '0.75rem 0.25rem',
4648
boxSizing: 'border-box',
@@ -51,7 +53,10 @@ function SandboxActions({ store, signals }) {
5153
})
5254
}
5355
>
54-
Delete Sandbox
56+
<CenteredText>
57+
<TrashIcon />
58+
<span>Delete Sandbox</span>
59+
</CenteredText>
5560
</Button>
5661
</WorkspaceInputContainer>
5762
</div>

packages/common/theme.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const theme = createTheme({
5858
green: '#5da700',
5959
redBackground: '#400000',
6060
red: '#F27777',
61+
dangerBackground: '#DC3545',
6162
});
6263

6364
export default theme;

0 commit comments

Comments
 (0)