adding fb and other quick things like gdrive navigation

This commit is contained in:
talksik
2019-09-01 15:31:55 -07:00
parent 40e4b3c7b4
commit 91f26a839b
2 changed files with 61 additions and 3 deletions
+35 -3
View File
@@ -19,15 +19,17 @@ const AvailableCommandsIcons = props => {
src={'https://image.flaticon.com/icons/png/512/281/281769.png'} src={'https://image.flaticon.com/icons/png/512/281/281769.png'}
/> />
</Tooltip> </Tooltip>
{/* Reddit */}
<Tooltip title="red"> {/* Google Calendar */}
<Tooltip title="gcal">
<img <img
className={styles.icon} className={styles.icon}
src={ src={
'https://cdn0.iconfinder.com/data/icons/social-media-2092/100/social-36-512.png' 'https://storage.googleapis.com/gweb-uniblog-publish-prod/images/logo_calendar_color_2x_web_512dp.max-1100x1100.png'
} }
/> />
</Tooltip> </Tooltip>
{/* Youtube */} {/* Youtube */}
<Tooltip title="utube"> <Tooltip title="utube">
<img <img
@@ -38,6 +40,26 @@ const AvailableCommandsIcons = props => {
/> />
</Tooltip> </Tooltip>
{/* Google Drive */}
<Tooltip title="gdrive">
<img
className={styles.icon}
src={
'http://www.iconarchive.com/download/i80454/uiconstock/socialmedia/Google-Drive.ico'
}
/>
</Tooltip>
{/* Reddit */}
<Tooltip title="red">
<img
className={styles.icon}
src={
'https://cdn0.iconfinder.com/data/icons/social-media-2092/100/social-36-512.png'
}
/>
</Tooltip>
{/* Twitter */} {/* Twitter */}
<Tooltip title="twit"> <Tooltip title="twit">
<img <img
@@ -47,6 +69,16 @@ const AvailableCommandsIcons = props => {
} }
/> />
</Tooltip> </Tooltip>
{/* Twitter */}
<Tooltip title="fb">
<img
className={styles.icon}
src={
'https://www.petconnectrescue.org/wp-content/uploads/2016/10/FB-icon.png'
}
/>
</Tooltip>
{/* Slack */} {/* Slack */}
{/* <img {/* <img
className={styles.icon} className={styles.icon}
+26
View File
@@ -152,6 +152,17 @@ class MainCommand extends Component {
newInput = newInput.replace('twit', ''); newInput = newInput.replace('twit', '');
newCommandComplete = true; newCommandComplete = true;
newCommandInputPlaceholder = "what's happening"; newCommandInputPlaceholder = "what's happening";
} else if (
newInput.includes('gdrive') &&
newCommandIcon == envVars.DEFAULT_LOGO
) {
// execute command right away and reset
newCommand = 'gdrive';
newCommandComplete = true;
window.location = 'https://drive.google.com';
this.setState(INITIAL_COMMAND_STATE);
} else if ( } else if (
newInput.includes('gcal') && newInput.includes('gcal') &&
newCommandIcon == envVars.DEFAULT_LOGO newCommandIcon == envVars.DEFAULT_LOGO
@@ -163,6 +174,16 @@ class MainCommand extends Component {
window.location = 'https://calendar.google.com/calendar/r'; window.location = 'https://calendar.google.com/calendar/r';
this.setState(INITIAL_COMMAND_STATE); this.setState(INITIAL_COMMAND_STATE);
} else if (
newInput.includes('fb') &&
newCommandIcon == envVars.DEFAULT_LOGO
) {
newCommand = 'fb';
newCommandIcon =
'https://www.petconnectrescue.org/wp-content/uploads/2016/10/FB-icon.png';
newInput = newInput.replace('fb', '');
newCommandComplete = true;
newCommandInputPlaceholder = 'search for people, groups, etc.';
} // this one must be last, as its the default google search } // this one must be last, as its the default google search
else if (newCommand == 'google') { else if (newCommand == 'google') {
newCommand = 'google'; newCommand = 'google';
@@ -240,6 +261,11 @@ class MainCommand extends Component {
window.location = 'https://www.reddit.com/r/' + commandInput; window.location = 'https://www.reddit.com/r/' + commandInput;
} else if (this.state.command == 'twitter') { } else if (this.state.command == 'twitter') {
window.location = 'https://twitter.com/search?q=' + commandInput; window.location = 'https://twitter.com/search?q=' + commandInput;
} else if (this.state.command == 'fb') {
var transformedSearchQuery = commandInput.replace(' ', '%20');
var fbUrl =
'https://www.facebook.com/search/top/?q=' + transformedSearchQuery;
window.location = fbUrl;
} }
this.setState(INITIAL_COMMAND_STATE, () => { this.setState(INITIAL_COMMAND_STATE, () => {