Smaller quick-fixes for app-js (#756)

* Fix wrong copyToClipboard link

* Removed duplicate 'js--App' wrapper

* Fixed overflow in editor for longer code examples
This commit is contained in:
Stefanie Doll 2019-02-24 13:33:44 +01:00 committed by GitHub
parent 3acd9c16c2
commit b56480c9ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View File

@ -315,7 +315,11 @@ class Playground extends React.PureComponent<Props, State> {
history.push(path);
}
this.copyToClipboard(`${window.location.origin}/#${path}`);
const basePath = window.location.pathname.replace('/', '').length > 0
? `${window.location.origin}/${window.location.pathname.replace('/', '')}`
: `${window.location.origin}`;
this.copyToClipboard(`${basePath}/#${path}`);
}
private copyToClipboard = (link: string): void => {

View File

@ -64,7 +64,6 @@
.codeflask--has-line-numbers .codeflask__flatten {
font-size: 12px;
height: 99.99%;
line-height: 18px;
min-width: calc(100% - 40px);
width: auto;

View File

@ -17,12 +17,10 @@ class AppJs extends React.PureComponent<Props> {
const { basePath } = this.props;
return (
<main className='js--App'>
<Switch>
<Route path={`${basePath}/share/:base64`} component={Playground} />
<Route component={Playground} />
</Switch>
</main>
<Switch>
<Route path={`${basePath}/share/:base64`} component={Playground} />
<Route component={Playground} />
</Switch>
);
}
}