adding amazon icon

This commit is contained in:
talksik
2019-10-06 11:45:41 -07:00
parent 8b44fc4f6e
commit c18c54ad9c
2 changed files with 23 additions and 2 deletions
+9 -2
View File
@@ -64,6 +64,15 @@ const AvailableCommandsIcons = props => {
} }
/> />
</Tooltip> </Tooltip>
{/* Amazon */}
<Tooltip title="amz">
<img
className={styles.icon}
src={'http://lofrev.net/wp-content/photos/2016/06/amazon-logo-1.png'}
/>
</Tooltip>
{/* Twitter */} {/* Twitter */}
<Tooltip title="twit"> <Tooltip title="twit">
<img <img
@@ -73,7 +82,6 @@ const AvailableCommandsIcons = props => {
} }
/> />
</Tooltip> </Tooltip>
{/* Facebook */} {/* Facebook */}
<Tooltip title="fb"> <Tooltip title="fb">
<img <img
@@ -83,7 +91,6 @@ const AvailableCommandsIcons = props => {
} }
/> />
</Tooltip> </Tooltip>
{/* Slack */} {/* Slack */}
{/* <img {/* <img
className={styles.icon} className={styles.icon}
+14
View File
@@ -194,6 +194,16 @@ class MainCommand extends Component {
newInput = newInput.replace('lkin', ''); newInput = newInput.replace('lkin', '');
newCommandComplete = true; newCommandComplete = true;
newCommandInputPlaceholder = 'search for people, jobs, etc.'; newCommandInputPlaceholder = 'search for people, jobs, etc.';
} else if (
newInput.includes('amz') &&
newCommandIcon == envVars.DEFAULT_LOGO
) {
newCommand = 'amz';
newCommandIcon =
'http://lofrev.net/wp-content/photos/2016/06/amazon-logo-1.png';
newInput = newInput.replace('amz', '');
newCommandComplete = true;
newCommandInputPlaceholder = 'buy anything';
} // 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';
@@ -280,6 +290,10 @@ class MainCommand extends Component {
'https://www.linkedin.com/search/results/all/?keywords=' + 'https://www.linkedin.com/search/results/all/?keywords=' +
transformedSearchQuery; transformedSearchQuery;
window.location = lkinUrl; window.location = lkinUrl;
} else if (this.state.command == 'amz') {
var transformedSearchQuery = commandInput.replace(' ', '+');
var lkinUrl = 'https://www.amazon.com/s?k=' + transformedSearchQuery;
window.location = lkinUrl;
} }
this.setState(INITIAL_COMMAND_STATE, () => { this.setState(INITIAL_COMMAND_STATE, () => {