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>
{/* Amazon */}
<Tooltip title="amz">
<img
className={styles.icon}
src={'http://lofrev.net/wp-content/photos/2016/06/amazon-logo-1.png'}
/>
</Tooltip>
{/* Twitter */}
<Tooltip title="twit">
<img
@@ -73,7 +82,6 @@ const AvailableCommandsIcons = props => {
}
/>
</Tooltip>
{/* Facebook */}
<Tooltip title="fb">
<img
@@ -83,7 +91,6 @@ const AvailableCommandsIcons = props => {
}
/>
</Tooltip>
{/* Slack */}
{/* <img
className={styles.icon}
+14
View File
@@ -194,6 +194,16 @@ class MainCommand extends Component {
newInput = newInput.replace('lkin', '');
newCommandComplete = true;
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
else if (newCommand == 'google') {
newCommand = 'google';
@@ -280,6 +290,10 @@ class MainCommand extends Component {
'https://www.linkedin.com/search/results/all/?keywords=' +
transformedSearchQuery;
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, () => {