refactor: removed unnecessary tile size variable

This commit is contained in:
Riccardo
2023-12-18 15:56:32 +01:00
parent 28a35dbf41
commit 875d66f2f7
5 changed files with 34 additions and 64 deletions

View File

@@ -6,11 +6,9 @@ import { TileContent } from './tileContent';
type CardProps = {
newsA?: z.infer<typeof NewsSchema>;
newsB?: z.infer<typeof NewsSchema>;
width: number;
height: number;
};
export function Tile({ newsA, newsB, width, height }: CardProps) {
export function Tile({ newsA, newsB }: CardProps) {
const [switched, setSwitched] = useState(false);
const [active, setActive] = useState(Math.random() < 0.5);
const [delayed, setDelayed] = useState(true);
@@ -41,8 +39,8 @@ export function Tile({ newsA, newsB, width, height }: CardProps) {
<div className='transform-gpu'>
<div className={`absolute left-0 top-0 w-full ${''}`}>
{active
? TileContent({ story: newsA, width, height, side: true })
: TileContent({ story: newsB, width, height, side: false })}
? TileContent({ story: newsA, side: true })
: TileContent({ story: newsB, side: false })}
</div>
</div>
</div>