forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsandbox-github.stories.tsx
More file actions
143 lines (132 loc) · 3.98 KB
/
sandbox-github.stories.tsx
File metadata and controls
143 lines (132 loc) · 3.98 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import React from 'react';
import {
Element,
Button,
Collapsible,
Icon,
Input,
List,
ListAction,
Textarea,
Stack,
Text,
} from '../index';
import { IntegrationGitHub } from '../components/Integration/index.stories';
export default {
title: 'examples/SandboxGithub',
};
const Sidebar = props => (
<Element
as="aside"
css={{
width: '200px',
height: '100vh',
borderRight: '1px solid',
borderColor: 'sideBar.border',
position: 'relative', // for absolute position delete button
}}
{...props}
/>
);
export const NotLoggedIn = () => (
<Sidebar>
<Collapsible title="Github" defaultOpen>
<Element css={{ paddingX: 2 }}>
<Text size={2} variant="muted" block marginBottom={4}>
You can create commits and open pull request if you add GitHub to your
intergrations.
</Text>
<IntegrationGitHub />
</Element>
</Collapsible>
</Sidebar>
);
export const NotConnected = () => (
<Sidebar>
<Collapsible title="Github" defaultOpen>
<Element css={{ paddingX: 2 }}>
<Text size={3} weight="semibold" block marginBottom={4}>
Export Sandbox to GitHub
</Text>
<Stack as="form" direction="vertical" gap={2}>
<Input type="text" placeholder="Enter repository url" />
<Button>Create Repository</Button>
</Stack>
</Element>
</Collapsible>
</Sidebar>
);
export const Connected = () => (
<Sidebar>
<Collapsible title="Github" defaultOpen>
<Element css={{ paddingX: 2 }}>
<Stack gap={2} marginBottom={6} align="center">
<Icon name="github" />
<Text size={2}>codesandbox/components</Text>
</Stack>
<Element>
<Text variant="muted">There are no changes</Text>
</Element>
</Element>
</Collapsible>
<Collapsible title="Export to GitHub" defaultOpen>
<Element css={{ paddingX: 2 }}>
<Stack as="form" direction="vertical" gap={2}>
<Input type="text" placeholder="Enter repository url" />
<Button variant="secondary">Create Repository</Button>
</Stack>
</Element>
</Collapsible>
</Sidebar>
);
export const Changes = () => (
<Sidebar>
<Collapsible title="Github" defaultOpen>
<Element css={{ paddingX: 2 }}>
<Stack gap={2} marginBottom={6}>
<Icon name="github" />
<Text size={2}>codesandbox/components</Text>
</Stack>
</Element>
<Element>
<Text size={3} block marginBottom={2} marginX={2}>
Changes (4)
</Text>
<List marginBottom={6}>
<ListAction gap={2}>
<Icon name="gitAdded" color="#30D158" />
<Text variant="muted">src/index.js</Text>
</ListAction>
<ListAction gap={2}>
<Icon name="gitRemoved" color="#FF453A" />
<Text variant="muted">src/style.css</Text>
</ListAction>
<ListAction gap={2}>
<Icon name="gitModified" color="#F69935" />
<Text variant="muted">package.json</Text>
</ListAction>
<ListAction gap={2}>
<Icon name="gitModified" color="#F69935" />
<Text variant="muted">dist.js</Text>
</ListAction>
</List>
<Text size={3} block marginBottom={2} marginX={2}>
Commit Message
</Text>
<Stack as="form" direction="vertical" gap={1} marginX={2}>
<Input placeholder="Subject" />
<Textarea maxLength={280} placeholder="Description" />
<Button variant="secondary">Open Pull Request</Button>
</Stack>
</Element>
</Collapsible>
<Collapsible title="Export to GitHub" defaultOpen>
<Element css={{ paddingX: 2 }}>
<Stack as="form" direction="vertical" gap={2}>
<Input type="text" placeholder="Enter repository url" />
<Button variant="secondary">Create Repository</Button>
</Stack>
</Element>
</Collapsible>
</Sidebar>
);