-
-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10736 from fcannizzaro/add-stream-deck-selection-…
…deep-link Add Stream Deck deep-link selection
- Loading branch information
Showing
17 changed files
with
148 additions
and
97 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
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 |
---|---|---|
|
@@ -109,7 +109,3 @@ | |
.artifactMods { | ||
--item-size: 40px; | ||
} | ||
|
||
.disableEvents > div { | ||
pointer-events: none; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
11 changes: 11 additions & 0 deletions
11
src/app/stream-deck/OpenOnStreamDeckButton/OpenOnStreamDeckButton.m.scss
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,11 @@ | ||
.icon { | ||
margin-right: 8px; | ||
} | ||
|
||
.link { | ||
text-decoration: none; | ||
} | ||
|
||
.link span { | ||
padding-right: 8px; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/app/stream-deck/OpenOnStreamDeckButton/OpenOnStreamDeckButton.m.scss.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/app/stream-deck/OpenOnStreamDeckButton/OpenOnStreamDeckButton.tsx
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,29 @@ | ||
import { t } from 'app/i18next-t'; | ||
import { DimItem } from 'app/inventory/item-types'; | ||
import ActionButton from 'app/item-actions/ActionButton'; | ||
import { BucketHashes } from 'data/d2/generated-enums'; | ||
import streamDeckIcon from 'images/streamDeck.svg'; | ||
import { useStreamDeckSelection } from '../stream-deck'; | ||
import styles from './OpenOnStreamDeckButton.m.scss'; | ||
|
||
export default function OpenOnStreamDeckButton({ item, label }: { item: DimItem; label: boolean }) { | ||
const deepLink = useStreamDeckSelection({ | ||
type: 'item', | ||
item, | ||
isSubClass: item.bucket.hash === BucketHashes.Subclass, | ||
equippable: !item.notransfer, | ||
}); | ||
|
||
if (!deepLink) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<a href={deepLink} target="_blank" className={styles.link}> | ||
<ActionButton onClick={() => null}> | ||
<img src={streamDeckIcon} className={styles.icon} /> | ||
{label && <span>{t('MovePopup.OpenOnStreamDeck')}</span>} | ||
</ActionButton> | ||
</a> | ||
); | ||
} |
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
Oops, something went wrong.