bilder gen
This commit is contained in:
@@ -75,7 +75,11 @@ export default function ProfilScreen() {
|
||||
<Text style={s.gruppeTitel}>{t.titel}</Text>
|
||||
<ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={s.reihe}>
|
||||
{davon.map((m) => (
|
||||
<ModellKachel key={m.$id} modell={m} />
|
||||
<ModellKachel
|
||||
key={m.$id}
|
||||
modell={m}
|
||||
aufDruck={() => router.push({ pathname: '/modell/[id]', params: { id: m.$id } })}
|
||||
/>
|
||||
))}
|
||||
</ScrollView>
|
||||
</View>
|
||||
@@ -143,21 +147,34 @@ function OrdnerZeile({
|
||||
);
|
||||
}
|
||||
|
||||
function ModellKachel({ modell }: { modell: AssetMitBild }) {
|
||||
const quelle = useBildQuelle(modell.titelbildId);
|
||||
function ModellKachel({ modell, aufDruck }: { modell: AssetMitBild; aufDruck: () => void }) {
|
||||
const quelle = useBildQuelle(modell.titelbildId, modell.titelbildBucket);
|
||||
return (
|
||||
<View style={s.kachel}>
|
||||
{quelle ? (
|
||||
<Image source={quelle} style={s.kachelBild} contentFit="cover" transition={150} />
|
||||
) : (
|
||||
<View style={[s.kachelBild, s.kachelLeer]}>
|
||||
<Ionicons name={iconFuer(modell.typ)} size={22} color={colors.faint} />
|
||||
</View>
|
||||
)}
|
||||
<Pressable
|
||||
onPress={aufDruck}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={`${modell.name} öffnen`}
|
||||
style={({ pressed }) => [s.kachel, pressed ? s.gedrueckt : null]}>
|
||||
<View>
|
||||
{quelle ? (
|
||||
<Image source={quelle} style={s.kachelBild} contentFit="cover" transition={150} />
|
||||
) : (
|
||||
<View style={[s.kachelBild, s.kachelLeer]}>
|
||||
<Ionicons name={iconFuer(modell.typ)} size={22} color={colors.faint} />
|
||||
</View>
|
||||
)}
|
||||
{/* Ohne freigegebene Version ist das Modell nicht einsetzbar – das muss
|
||||
man sehen, bevor man es in einem Post auswählen will. */}
|
||||
{modell.wartet ? (
|
||||
<View style={s.wartetChip}>
|
||||
<Text style={s.wartetText}>wählen</Text>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
<Text style={s.kachelName} numberOfLines={1}>
|
||||
{modell.name}
|
||||
</Text>
|
||||
</View>
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -202,6 +219,12 @@ const s = StyleSheet.create({
|
||||
},
|
||||
kachelLeer: { alignItems: 'center', justifyContent: 'center' },
|
||||
kachelName: { ...text.label, color: colors.mut },
|
||||
wartetChip: {
|
||||
position: 'absolute', bottom: 5, left: 5,
|
||||
backgroundColor: colors.gold, borderRadius: radius.pill,
|
||||
paddingHorizontal: space.sm, paddingVertical: 1,
|
||||
},
|
||||
wartetText: { fontSize: 10, fontWeight: '700', color: '#000' },
|
||||
|
||||
fuss: { gap: space.md, marginTop: space.md },
|
||||
fussText: { ...text.mono, color: colors.faint },
|
||||
|
||||
Reference in New Issue
Block a user