This repository has been archived by the owner on Jun 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Initial checkin Remote file. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Reverts updates to radio button and switch. Change submitted via separate PR. * Updates selectedValue when cloning. * Fixes selectedValue float in range variable. * Updates controlTypes that should throttle. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Progress checkin Remote controller. * Initial check-in of overlay share menu * Final check-in. * Final check-in. * Progress checkin remote share menu. * Reverts remote files changed in separate diff. * Progress checkin remote share menu. * Updates comments. * Updates CSS * Now using OverlayController state to manage share menu visibility. * Modifies toggleShareMenu method.
- Loading branch information
Showing
4 changed files
with
192 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/** @license | ||
* Copyright 2016 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy | ||
* of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import * as React from "react"; | ||
|
||
import { CSS } from "../lib/Constants"; | ||
|
||
/** | ||
* Interface for the overlay share menu properties. | ||
* @interface | ||
*/ | ||
export interface IOverlayShareMenuProps { | ||
visible: boolean; | ||
remoteId: string; | ||
remoteUrl: string; | ||
isEnabled: boolean; | ||
toggleRemoteEnabled(): void; | ||
} | ||
|
||
/** | ||
* Renders a collapsable remote share menu. | ||
* | ||
* @class | ||
* @extends React.Component | ||
*/ | ||
export class OverlayShareMenu extends React.Component<IOverlayShareMenuProps, void> { | ||
|
||
/** @override */ | ||
render() { | ||
const { | ||
visible, | ||
remoteId, | ||
remoteUrl, | ||
isEnabled | ||
} = this.props; | ||
|
||
let showMenu = visible ? "active" : ""; | ||
let status = isEnabled ? "on" : "off"; | ||
|
||
return ( | ||
<div | ||
className={`${CSS.RMX_SHARE_MENU} mdl-card__actions ${showMenu}`} | ||
> | ||
<div className={CSS.MDL_LIST}> | ||
<div className={`${CSS.MDL_LIST_ITEM} ${CSS.MDL_TWO_LINE} on`}> | ||
<span className={CSS.MDL_PRIMARY}> | ||
<span><strong>{`Sharing is ${status}`}</strong></span> | ||
<span className="mdl-list__item-sub-title"> | ||
These values can be adjusted by anyone with the link. | ||
</span> | ||
</span> | ||
<span className={CSS.MDL_SECONDARY}> | ||
<label | ||
className="mdl-switch mdl-js-switch mdl-js-ripple-effect" | ||
htmlFor="share-switch" | ||
> | ||
<input | ||
id="share-switch" type="checkbox" className="mdl-switch__input" | ||
checked={isEnabled} | ||
onChange={this.props.toggleRemoteEnabled} | ||
/> | ||
</label> | ||
</span> | ||
</div> | ||
<div className={`${CSS.MDL_LIST_ITEM} ${CSS.MDL_TWO_LINE} ${status}`}> | ||
<span className={CSS.MDL_PRIMARY}> | ||
<span>Link</span> | ||
<span className="mdl-list__item-sub-title"> | ||
<a href={remoteUrl} target="_blank">{remoteUrl}</a> | ||
</span> | ||
</span> | ||
<span className={CSS.MDL_SECONDARY}> | ||
<a href={remoteUrl} target="_blank"> | ||
<i className="material-icons">share</i> | ||
</a> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters