Skip to content

Commit

Permalink
releasef stability improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammers21 committed Feb 25, 2024
1 parent 8b18187 commit d4d3d40
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 80 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ const Header = () => {
function redirectToLadder() {
navigateToPage({
activity: "ladder",
bracket: isMeta ? BRACKETS.shuffle : bracket,
bracket: isMeta || isShuffleMclass ? BRACKETS.shuffle : bracket,
});
}

function redirectToActivity() {
navigateToPage({
activity: "activity",
bracket: isMeta ? BRACKETS.shuffle : bracket,
bracket: isMeta || isShuffleMclass ? BRACKETS.shuffle : bracket,
});
}

Expand Down
84 changes: 42 additions & 42 deletions frontend/src/containers/Profile/PlayerCard/Desktop.tsx
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;
72 changes: 36 additions & 36 deletions frontend/src/containers/Profile/PlayerCard/Modile.tsx
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;
7 changes: 7 additions & 0 deletions frontend/src/utils/urlparts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IPlayer } from '@/types';
import { BRACKETS } from '../constants/pvp-activity';
import { REGION } from '../constants/region';

Expand Down Expand Up @@ -36,3 +37,9 @@ export function capitalizeNickname(nickname?: string) {
? `${name}-${realm} ${capitalize(nicknameParts[2])}`
: `${name}-${realm}`;
}

export function openWowArmory(player: IPlayer) {
const fixedRealm = player.realm.replaceAll("'", "")
const url = `https://worldofwarcraft.blizzard.com/en-gb/character/${player.region}/${fixedRealm}/${player.name}`;
window.open(url, '_blank');
}

0 comments on commit d4d3d40

Please sign in to comment.