Skip to content

Commit 863c31a

Browse files
siddharthkpCompuIves
authored andcommitted
Hide light theme behind feature flag (codesandbox#3016)
* get split pane to work in embed * add a cute little toggle * snap to edges * get default size from props * handle toggle position for different vertical views * get full height back * add transition for resize toggle * breaking things to test on mobile * bring back the toggle * header buttons work again * hide resizer on mobile * only offset height if header is visible * handle 50% and pane container * add transition to snap * add sidebar toggle to header * handle screen resize * vertical panes only * remove header for mobile * refactor and simplify code * Move the heart button to preview * refactor actions + add refresh * add button to open in new window * get the right icons * fade transition * get animation right for navigation actions * add border on all sides for preview * Add types for new props * i dont know what to tell you fam * increase tap width for resizer * increase snap radius for the right side * add threshold for showing navigation icons on smaller screens * (has bugs) add click functionality for resizer * rename width to newSize * add opacity for border * update icons for navigation * move global actions inside splitpane * position open sandbox lower for editor * fold when like overlaps + isDragging transition * first stab at intro animation * animation intensifies * i think thats good * introduce on load for mobile * fix the animation timeline * fix opacity for animation * variables good good * use window.outerWidth because that doesnt lie * dont wait for mouseover on mobile * oh noes, outerWidth is also a lie * solve preview size problems * rename embed theme to dark * start new theme * move theme provider to App * introduce getTheme * add harcoded variant * read theme from url * refactor sidebar elements to system * sidebar info on theme * systemetise file tree * panel + content container * cheeseburget * fix the height of tabs and navigator * remove icons from tabs in embed * theming wip * style preview components * fix embed background * decide top offset for preview based on navigation flag * add theme drop down to share sheet * more night own less custom * punctuations * add poor man's feature flag
1 parent 699ee88 commit 863c31a

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66

77
 
88

9-
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/codesandbox) [![All Contributors](https://img.shields.io/badge/all_contributors-153-orange.svg?style=flat-square)](#contributors-) [![CircleCI](https://circleci.com/gh/codesandbox/codesandbox-client.svg?style=svg)](https://circleci.com/gh/codesandbox/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
9+
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/codesandbox)
10+
[![All Contributors](https://img.shields.io/badge/all_contributors-153-orange.svg?style=flat-square)](#contributors-)
11+
[![CircleCI](https://circleci.com/gh/codesandbox/codesandbox-client.svg?style=svg)](https://circleci.com/gh/codesandbox/codesandbox-client)
12+
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)
13+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
14+
[![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
15+
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
1016

1117
[![Backers on Open Collective](https://opencollective.com/codesandbox/backers/badge.svg)](#backers)
1218
[![Sponsors on Open Collective](https://opencollective.com/codesandbox/sponsors/badge.svg)](#sponsors)
@@ -252,6 +258,7 @@ Thanks goes to these wonderful people
252258

253259
<!-- markdownlint-enable -->
254260
<!-- prettier-ignore-end -->
261+
255262
<!-- ALL-CONTRIBUTORS-LIST:END -->
256263

257264
## Backers

packages/app/scripts/sentry-create-release.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
const childProcess = require('child_process');
23
const VERSION = require('@codesandbox/common/lib/version').default;
34

packages/app/src/app/pages/common/Modals/ShareModal/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name';
66
import track from '@codesandbox/common/lib/utils/analytics';
77
import { Button } from '@codesandbox/common/lib/components/Button';
88
import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator';
9+
import { EMBED_LIGHT_THEME } from '@codesandbox/common/lib/utils/feature-flags';
910
import Title from './Title';
1011

1112
import {
@@ -163,13 +164,15 @@ class ShareView extends React.Component {
163164
value={view}
164165
setValue={this.setView}
165166
/>
166-
<PaddedPreference
167-
title="Theme"
168-
type="dropdown"
169-
options={THEME_OPTIONS}
170-
value={theme}
171-
setValue={this.setTheme}
172-
/>
167+
{EMBED_LIGHT_THEME && (
168+
<PaddedPreference
169+
title="Theme"
170+
type="dropdown"
171+
options={THEME_OPTIONS}
172+
value={theme}
173+
setValue={this.setTheme}
174+
/>
175+
)}
173176
<PaddedPreference
174177
title="Auto resize"
175178
type="boolean"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
poor man's feature flags
3+
4+
you can export a constant which enables/disables a feature
5+
6+
it's a JS file, so you can add whatever logic you want as long as it's static
7+
*/
8+
9+
export const EMBED_LIGHT_THEME = true;

standalone-packages/codesandbox-browserfs/src/backend/CodeSandboxEditorFS.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
import {
23
SynchronousFileSystem,
34
FileSystem,

0 commit comments

Comments
 (0)