-
Notifications
You must be signed in to change notification settings - Fork 26
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 #126 from TheLazySquid/playerlinks
Add more sites to view profiles in
- Loading branch information
Showing
8 changed files
with
159 additions
and
22 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
66 changes: 66 additions & 0 deletions
66
src/components/TF2/Player/Modals/ConfirmNavigationModal.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,66 @@ | ||
import { Button, Checkbox } from '@components/General'; | ||
import { useModal } from '@context'; | ||
import React from 'react'; | ||
|
||
interface ConfirmNavigationModalProps { | ||
link: string; | ||
onConfirm?: () => void; | ||
onCancel?: () => void; | ||
onDontShowAgain?: () => void; | ||
} | ||
|
||
const ConfirmNavigationModal = ({ | ||
link, | ||
onConfirm, | ||
onCancel, | ||
onDontShowAgain, | ||
}: ConfirmNavigationModalProps) => { | ||
const [dontShowAgain, setDontShowAgain] = React.useState(false); | ||
|
||
const { closeModal } = useModal(); | ||
|
||
const handleAction = () => { | ||
if (dontShowAgain) { | ||
onDontShowAgain?.(); | ||
} | ||
closeModal(); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<div className="mb-5 text-lg"> | ||
You are about to open a link to an external site:{' '} | ||
{new URL(link).hostname}. | ||
<br /> | ||
Are you sure you want to continue? | ||
</div> | ||
<div className="w-full flex gap-3 justify-end items-center"> | ||
Don't show this again | ||
<Checkbox | ||
checked={dontShowAgain} | ||
onChange={(checked) => { | ||
setDontShowAgain(checked); | ||
}} | ||
/> | ||
<Button | ||
onClick={() => { | ||
handleAction(); | ||
onCancel?.(); | ||
}} | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
onClick={() => { | ||
handleAction(); | ||
onConfirm?.(); | ||
}} | ||
> | ||
Proceed | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ConfirmNavigationModal; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const profileLinks = [ | ||
['Steamrep', 'https://steamrep.com/profiles/{{ID64}}'], | ||
['Backpack.tf', 'https://backpack.tf/profiles/{{ID64}}'], | ||
['SteamHistory', 'https://steamhistory.net/id/{{ID64}}'], | ||
['RGL', 'https://rgl.gg/Public/PlayerProfile?p={{ID64}}'], | ||
['Logs.tf', 'https://logs.tf/profile/{{ID64}}'], | ||
['Demos.tf', 'https://demos.tf/profiles/{{ID64}}'], | ||
['Trends.tf', 'https://trends.tf/player/{{ID64}}'], | ||
['ETF2L', 'https://etf2l.org/search/{{ID64}}'], | ||
['UGC', 'https://www.ugcleague.com/players_page.cfm?player_id={{ID64}}'], | ||
['Ozfortress', 'https://ozfortress.com/users/steam_id/{{ID64}}'], | ||
]; |