tweak image styles
This commit is contained in:
@@ -88,7 +88,7 @@ export function ConstrainedImage({
|
|||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.h_full,
|
a.h_full,
|
||||||
a.rounded_sm,
|
a.rounded_md,
|
||||||
a.overflow_hidden,
|
a.overflow_hidden,
|
||||||
t.atoms.bg_contrast_25,
|
t.atoms.bg_contrast_25,
|
||||||
fullBleed ? a.w_full : {aspectRatio},
|
fullBleed ? a.w_full : {aspectRatio},
|
||||||
@@ -219,7 +219,7 @@ export function AutoSizedImage({
|
|||||||
accessibilityHint={_(msg`Tap to view full image`)}
|
accessibilityHint={_(msg`Tap to view full image`)}
|
||||||
style={[
|
style={[
|
||||||
a.w_full,
|
a.w_full,
|
||||||
a.rounded_sm,
|
a.rounded_md,
|
||||||
a.overflow_hidden,
|
a.overflow_hidden,
|
||||||
t.atoms.bg_contrast_25,
|
t.atoms.bg_contrast_25,
|
||||||
{aspectRatio: max},
|
{aspectRatio: max},
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ export const GalleryItem: FC<GalleryItemProps> = ({
|
|||||||
onLongPress={onLongPress ? () => onLongPress(index) : undefined}
|
onLongPress={onLongPress ? () => onLongPress(index) : undefined}
|
||||||
style={[
|
style={[
|
||||||
a.flex_1,
|
a.flex_1,
|
||||||
a.rounded_sm,
|
|
||||||
a.overflow_hidden,
|
a.overflow_hidden,
|
||||||
t.atoms.bg_contrast_25,
|
t.atoms.bg_contrast_25,
|
||||||
imageStyle,
|
imageStyle,
|
||||||
|
|||||||
@@ -26,10 +26,21 @@ export function ImageLayoutGrid({style, ...props}: ImageLayoutGridProps) {
|
|||||||
? a.gap_sm
|
? a.gap_sm
|
||||||
: a.gap_xs
|
: a.gap_xs
|
||||||
const count = props.images.length
|
const count = props.images.length
|
||||||
const aspectRatio = count === 2 ? 2 : count === 3 ? 1.5 : 1
|
let aspectRatio = 1
|
||||||
|
switch (count) {
|
||||||
|
case 2:
|
||||||
|
aspectRatio = 2
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
aspectRatio = 2
|
||||||
|
break
|
||||||
|
case 4:
|
||||||
|
aspectRatio = 1.5
|
||||||
|
break
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
<View style={[gap, {aspectRatio}]}>
|
<View style={[gap, a.rounded_md, a.overflow_hidden, {aspectRatio}]}>
|
||||||
<ImageLayoutGridInner {...props} gap={gap} />
|
<ImageLayoutGridInner {...props} gap={gap} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -65,14 +76,14 @@ function ImageLayoutGridInner(props: ImageLayoutGridInnerProps) {
|
|||||||
case 3:
|
case 3:
|
||||||
return (
|
return (
|
||||||
<View style={[a.flex_1, a.flex_row, gap]}>
|
<View style={[a.flex_1, a.flex_row, gap]}>
|
||||||
<View style={{flex: 2}}>
|
<View style={[a.flex_1]}>
|
||||||
<GalleryItem {...props} index={0} />
|
<GalleryItem {...props} index={0} />
|
||||||
</View>
|
</View>
|
||||||
<View style={[a.flex_1, gap]}>
|
<View style={[a.flex_1, gap]}>
|
||||||
<View style={[a.flex_1, {aspectRatio: 1}]}>
|
<View style={[a.flex_1]}>
|
||||||
<GalleryItem {...props} index={1} />
|
<GalleryItem {...props} index={1} />
|
||||||
</View>
|
</View>
|
||||||
<View style={[a.flex_1, {aspectRatio: 1}]}>
|
<View style={[a.flex_1]}>
|
||||||
<GalleryItem {...props} index={2} />
|
<GalleryItem {...props} index={2} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -83,18 +94,18 @@ function ImageLayoutGridInner(props: ImageLayoutGridInnerProps) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={[a.flex_row, gap]}>
|
<View style={[a.flex_row, gap]}>
|
||||||
<View style={[a.flex_1, {aspectRatio: 1}]}>
|
<View style={[a.flex_1, {aspectRatio: 1.5}]}>
|
||||||
<GalleryItem {...props} index={0} />
|
<GalleryItem {...props} index={0} />
|
||||||
</View>
|
</View>
|
||||||
<View style={[a.flex_1, {aspectRatio: 1}]}>
|
<View style={[a.flex_1, {aspectRatio: 1.5}]}>
|
||||||
<GalleryItem {...props} index={1} />
|
<GalleryItem {...props} index={1} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={[a.flex_row, gap]}>
|
<View style={[a.flex_row, gap]}>
|
||||||
<View style={[a.flex_1, {aspectRatio: 1}]}>
|
<View style={[a.flex_1, {aspectRatio: 1.5}]}>
|
||||||
<GalleryItem {...props} index={2} />
|
<GalleryItem {...props} index={2} />
|
||||||
</View>
|
</View>
|
||||||
<View style={[a.flex_1, {aspectRatio: 1}]}>
|
<View style={[a.flex_1, {aspectRatio: 1.5}]}>
|
||||||
<GalleryItem {...props} index={3} />
|
<GalleryItem {...props} index={3} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user