1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Zhiyuan Zheng 383ebc2775
Fixed #17
2021-02-08 23:47:20 +01:00

26 lines
371 B
TypeScript

const attachmentAspectRatio = ({
total,
index
}: {
total: number
index?: number
}) => {
switch (total) {
case 1:
case 4:
return 16 / 9
case 2:
return 8 / 9
case 3:
if (index === 2) {
return 32 / 9
} else {
return 16 / 9
}
default:
return 16 / 9
}
}
export default attachmentAspectRatio