adding amazon icon
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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, () => {
|
||||
|
||||
Reference in New Issue
Block a user