-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
87 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import { PlayerItemLvl, PlayerImages, PlayerName } from './common'; | ||
|
||
import type { IPlayer } from '@/types'; | ||
|
||
interface IProps { | ||
player: IPlayer; | ||
openArmory?: () => void; | ||
} | ||
|
||
const PlayerImage = ({ player }: IProps) => ( | ||
<> | ||
<div className="smoke-bg absolute left-0 top-0 w-full h-full bg-cover bg-no-repeat rounded-xl opacity-50" /> | ||
|
||
{player.media?.main_raw && ( | ||
<img | ||
className="-scale-x-100 object-cover select-none" | ||
alt="Player" | ||
src={player.media.main_raw} | ||
/> | ||
)} | ||
</> | ||
); | ||
|
||
const PlayerCard = ({ player }: IProps) => { | ||
const openArmory = () => { | ||
const url = `https://worldofwarcraft.blizzard.com/en-gb/character/${player.region}/${player.realm}/${player.name}`; | ||
window.open(url, '_blank'); | ||
}; | ||
|
||
return ( | ||
<div className="relative flex rounded-xl self-start border border-solid border-[#37415180] min-h-[415px]"> | ||
<PlayerImage player={player} /> | ||
|
||
<PlayerName player={player} openArmory={openArmory} desktop /> | ||
<PlayerImages player={player} desktop /> | ||
|
||
<PlayerItemLvl player={player} desktop /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PlayerCard; | ||
import { openWowArmory } from '@/utils/urlparts'; | ||
import { PlayerItemLvl, PlayerImages, PlayerName } from './common'; | ||
|
||
import type { IPlayer } from '@/types'; | ||
|
||
interface IProps { | ||
player: IPlayer; | ||
openArmory?: () => void; | ||
} | ||
|
||
const PlayerImage = ({ player }: IProps) => ( | ||
<> | ||
<div className="smoke-bg absolute left-0 top-0 w-full h-full bg-cover bg-no-repeat rounded-xl opacity-50" /> | ||
|
||
{player.media?.main_raw && ( | ||
<img | ||
className="-scale-x-100 object-cover select-none" | ||
alt="Player" | ||
src={player.media.main_raw} | ||
/> | ||
)} | ||
</> | ||
); | ||
|
||
const PlayerCard = ({ player }: IProps) => { | ||
const openArmory = () => { | ||
openWowArmory(player) | ||
}; | ||
|
||
return ( | ||
<div className="relative flex rounded-xl self-start border border-solid border-[#37415180] min-h-[415px]"> | ||
<PlayerImage player={player} /> | ||
|
||
<PlayerName player={player} openArmory={openArmory} desktop /> | ||
<PlayerImages player={player} desktop /> | ||
|
||
<PlayerItemLvl player={player} desktop /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PlayerCard; |
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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
import { PlayerItemLvl, PlayerImages, PlayerName } from './common'; | ||
import type { IPlayer } from '@/types'; | ||
|
||
interface IProps { | ||
player: IPlayer; | ||
openArmory?: () => void; | ||
} | ||
|
||
const PlayerCard = ({ player }: IProps) => { | ||
const openArmory = () => { | ||
const url = `https://worldofwarcraft.blizzard.com/en-gb/character/${player.region}/${player.realm}/${player.name}`; | ||
window.open(url, '_blank'); | ||
}; | ||
|
||
return ( | ||
<div className="flex rounded-lg gap-2 border border-solid border-[#37415180] px-2 py-2 bg-[#030303e6]"> | ||
{player.media?.avatar && ( | ||
<img | ||
className="object-cover select-none h-[80px] rounded-lg border border-solid border-[#60A5FA50]" | ||
alt="Player" | ||
src={player.media.avatar} | ||
/> | ||
)} | ||
<div className="flex grow justify-between"> | ||
<div className="flex flex-col justify-between"> | ||
<PlayerName player={player} openArmory={openArmory} /> | ||
<PlayerItemLvl player={player} /> | ||
</div> | ||
|
||
<PlayerImages player={player} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PlayerCard; | ||
import { openWowArmory } from "@/utils/urlparts"; | ||
import { PlayerItemLvl, PlayerImages, PlayerName } from "./common"; | ||
import type { IPlayer } from "@/types"; | ||
|
||
interface IProps { | ||
player: IPlayer; | ||
openArmory?: () => void; | ||
} | ||
|
||
const PlayerCard = ({ player }: IProps) => { | ||
const openArmory = () => { | ||
openWowArmory(player); | ||
}; | ||
|
||
return ( | ||
<div className="flex rounded-lg gap-2 border border-solid border-[#37415180] px-2 py-2 bg-[#030303e6]"> | ||
{player.media?.avatar && ( | ||
<img | ||
className="object-cover select-none h-[80px] rounded-lg border border-solid border-[#60A5FA50]" | ||
alt="Player" | ||
src={player.media.avatar} | ||
/> | ||
)} | ||
<div className="flex grow justify-between"> | ||
<div className="flex flex-col justify-between"> | ||
<PlayerName player={player} openArmory={openArmory} /> | ||
<PlayerItemLvl player={player} /> | ||
</div> | ||
|
||
<PlayerImages player={player} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PlayerCard; |
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