Separate alt/crop, use new icon (#5321)
parent
fddb1255ec
commit
0315814edd
|
@ -10,7 +10,7 @@ import {Dimensions} from '#/lib/media/types'
|
||||||
import {isNative} from '#/platform/detection'
|
import {isNative} from '#/platform/detection'
|
||||||
import {useLargeAltBadgeEnabled} from '#/state/preferences/large-alt-badge'
|
import {useLargeAltBadgeEnabled} from '#/state/preferences/large-alt-badge'
|
||||||
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
|
||||||
import {Crop_Stroke2_Corner0_Rounded as Crop} from '#/components/icons/Crop'
|
import {ArrowsDiagonalOut_Stroke2_Corner0_Rounded as Fullscreen} from '#/components/icons/ArrowsDiagonal'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
export function useImageAspectRatio({
|
export function useImageAspectRatio({
|
||||||
|
@ -147,33 +147,59 @@ export function AutoSizedImage({
|
||||||
style={[
|
style={[
|
||||||
a.absolute,
|
a.absolute,
|
||||||
a.flex_row,
|
a.flex_row,
|
||||||
a.align_center,
|
|
||||||
a.rounded_xs,
|
|
||||||
t.atoms.bg_contrast_25,
|
|
||||||
{
|
{
|
||||||
gap: 3,
|
|
||||||
padding: 3,
|
|
||||||
bottom: a.p_xs.padding,
|
bottom: a.p_xs.padding,
|
||||||
right: a.p_xs.padding,
|
right: a.p_xs.padding,
|
||||||
opacity: 0.8,
|
gap: 3,
|
||||||
},
|
},
|
||||||
largeAlt && [
|
largeAlt && [
|
||||||
{
|
{
|
||||||
gap: 4,
|
gap: 4,
|
||||||
padding: 5,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
]}>
|
]}>
|
||||||
{isCropped && (
|
{isCropped && (
|
||||||
<Crop
|
<View
|
||||||
fill={t.atoms.text_contrast_high.color}
|
style={[
|
||||||
width={largeAlt ? 18 : 12}
|
a.rounded_xs,
|
||||||
/>
|
t.atoms.bg_contrast_25,
|
||||||
|
{
|
||||||
|
padding: 3,
|
||||||
|
opacity: 0.8,
|
||||||
|
},
|
||||||
|
largeAlt && [
|
||||||
|
{
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
]}>
|
||||||
|
<Fullscreen
|
||||||
|
fill={t.atoms.text_contrast_high.color}
|
||||||
|
width={largeAlt ? 18 : 12}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
{hasAlt && (
|
{hasAlt && (
|
||||||
<Text style={[a.font_heavy, largeAlt ? a.text_xs : {fontSize: 8}]}>
|
<View
|
||||||
ALT
|
style={[
|
||||||
</Text>
|
a.justify_center,
|
||||||
|
a.rounded_xs,
|
||||||
|
t.atoms.bg_contrast_25,
|
||||||
|
{
|
||||||
|
padding: 3,
|
||||||
|
opacity: 0.8,
|
||||||
|
},
|
||||||
|
largeAlt && [
|
||||||
|
{
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
]}>
|
||||||
|
<Text
|
||||||
|
style={[a.font_heavy, largeAlt ? a.text_xs : {fontSize: 8}]}>
|
||||||
|
ALT
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
Loading…
Reference in New Issue