Merge branch 'feature/sketch-collections' of https://github.com/andrewn/p5.js-web-editor into feature/sketch-collections

This commit is contained in:
Andrew Nicolaou 2019-12-11 11:37:10 +01:00
commit 20c2c6c38b
3 changed files with 24 additions and 11 deletions

View file

@ -20,6 +20,7 @@ import Overlay from '../../App/components/Overlay';
import SketchList from '../../IDE/components/AddToCollectionSketchList';
import CopyableInput from '../../IDE/components/CopyableInput';
import { SketchSearchbar } from '../../IDE/components/Searchbar';
import dropdownArrow from '../../../images/down-arrow.svg';
const arrowUp = require('../../../images/sort-arrow-up.svg');
const arrowDown = require('../../../images/sort-arrow-down.svg');
@ -30,14 +31,14 @@ const ShareURL = ({ value }) => {
return (
<div className="collection-share">
{
showURL ?
<React.Fragment>
<span className="collection-share__label">Everyone can access the collection with this link</span>
<br />
<CopyableInput value={value} />
</React.Fragment> :
<button className="collection-share__button" onClick={() => setShowURL(true)}>Share</button>
<button className="collection-share__button" onClick={() => setShowURL(!showURL)}>
<span>Share</span>
<InlineSVG className="collection-share__arrow" src={dropdownArrow} />
</button>
{ showURL &&
<div className="collection__share-dropdown">
<CopyableInput value={value} label="Link to Collection" />
</div>
}
</div>
);

View file

@ -83,6 +83,10 @@
border: 2px solid getThemifyVariable('button-border-color');
border-radius: 2px;
padding: #{10 / $base-font-size}rem #{30 / $base-font-size}rem;
& g {
fill: getThemifyVariable('button-color');
opacity: 1;
}
&:enabled:hover {
border-color: getThemifyVariable('button-background-hover-color');
background-color: getThemifyVariable('button-background-hover-color');

View file

@ -84,21 +84,29 @@
.collection-share {
text-align: right;
position: relative;
}
.collection-share__button {
@extend %button;
display: flex;
align-items: center;
}
.collection-share__label {
display: block;
text-align: left;
.collection-share__arrow {
margin-left: #{5 / $base-font-size}rem;
}
.collection-share .copyable-input {
padding-bottom: 0;
}
.collection__share-dropdown {
@extend %dropdown-open-right;
padding: #{20 / $base-font-size}rem;
width: #{350 / $base-font-size}rem;
}
.collection-metadata__add-button {
@extend %button;
flex-grow: 0;