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

View file

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

View file

@ -84,21 +84,29 @@
.collection-share { .collection-share {
text-align: right; text-align: right;
position: relative;
} }
.collection-share__button { .collection-share__button {
@extend %button; @extend %button;
display: flex;
align-items: center;
} }
.collection-share__label { .collection-share__arrow {
display: block; margin-left: #{5 / $base-font-size}rem;
text-align: left;
} }
.collection-share .copyable-input { .collection-share .copyable-input {
padding-bottom: 0; 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 { .collection-metadata__add-button {
@extend %button; @extend %button;
flex-grow: 0; flex-grow: 0;