-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[US-206] Feat/us 206 theme item card (#155)
* feat: ✨ Thematically done. * chore: 🚧 Update title fonts * chore: 🚧 Update translations * chore: 🚧 Theme the see all button * bug: 🚑 Fix home screen * chore: 🚧 Improve namespacing of components and screens * feat: ✨ Implement the redesign of the theme items * chore: 🚧 Remove unused imports * chore: 🚧 Update translations * chore: 🚧 Show the image of theme items * chore: 🚧 Run eslint * chore: 🚧 Fix E2E tests * feat: ✨ Show the theme cards on the home screen * feat: ✨ Add haptic feedback * chore: 🚧 Optimize theme card on mobile screen * chore: 🚧 Update translations * chore: 🚧 Run eslint * chore: 🚧 Fix ci * chore: 🚧 Fix E2E tests * chore: 🚧 Fix E2E tests * chore: 🚧 Fix E2E tests * chore: 🚧 Fix ci (2) * chore: 🚧 Simplify using scrollable views * chore: 🚧 Fix tests * chore: 🚧 Simplify checking if an env setting is enabled --------- Co-authored-by: Yannick Bruintjes <[email protected]>
- Loading branch information
1 parent
2193cc2
commit ec759da
Showing
56 changed files
with
679 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import React from 'react'; | ||
import { | ||
Image, | ||
ImageSourcePropType, | ||
StyleSheet, | ||
View, | ||
ViewStyle, | ||
} from 'react-native'; | ||
|
||
import { shadow, useColorConfig } from '../../../lib/constants/Colors'; | ||
import { useFonts } from '../../../lib/constants/Fonts'; | ||
import { HapticFeedback, HapticForces } from '../../../lib/haptic/Hooks'; | ||
import { useNavigation } from '../../../lib/utility/navigation/useNavigation'; | ||
import { Routes } from '../../../routes/routes'; | ||
import { ReadMoreButton } from '../../general/buttons/ReadMoreButton'; | ||
import { TextTranslated } from '../../general/text/TextTranslated'; | ||
import { IntractableView } from '../../general/views/IntractableView'; | ||
|
||
type Props = { | ||
title: string; | ||
description: string; | ||
themeImage: ImageSourcePropType; | ||
themeSlug: string; | ||
style?: ViewStyle; | ||
}; | ||
|
||
export function ThemeItemCard({ | ||
title, | ||
description, | ||
themeImage, | ||
themeSlug, | ||
style, | ||
}: Props) { | ||
const colors = useColorConfig(); | ||
const fonts = useFonts(); | ||
const navigation = useNavigation(); | ||
|
||
const styles = StyleSheet.create({ | ||
card: { | ||
backgroundColor: colors.listItemBg, | ||
borderRadius: 10, | ||
padding: 16, | ||
marginBottom: 16, | ||
...shadow, | ||
}, | ||
container: { | ||
flexDirection: 'row', | ||
}, | ||
title: { | ||
...fonts.h2, | ||
color: colors.titleDefault, | ||
}, | ||
contentContainer: { | ||
marginLeft: 16, | ||
flex: 1, | ||
}, | ||
description: { | ||
...fonts.description, | ||
flexWrap: 'wrap', | ||
fontSize: 10, | ||
flexShrink: 1, | ||
}, | ||
button: { | ||
borderRadius: 8, | ||
padding: 0, | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
}, | ||
image: { | ||
borderRadius: 15, | ||
height: 75, | ||
width: 75, | ||
resizeMode: 'cover', | ||
}, | ||
buttonContainer: { | ||
marginLeft: 'auto', | ||
marginTop: 'auto', | ||
padding: 0, | ||
...fonts.smallLink, | ||
}, | ||
buttonText: { | ||
color: colors.text, | ||
...fonts.description, | ||
marginRight: 8, | ||
}, | ||
}); | ||
|
||
return ( | ||
<IntractableView | ||
style={[styles.card, style]} | ||
testID="theme-card" | ||
onPress={() => { | ||
HapticFeedback(HapticForces.Light); | ||
navigation.navigate(Routes.WindesheimTechRadar, { | ||
page: themeSlug, | ||
}); | ||
}} | ||
> | ||
<View style={styles.container}> | ||
<Image source={themeImage} style={styles.image} /> | ||
<View style={styles.contentContainer}> | ||
<TextTranslated style={styles.title} text={title} /> | ||
<TextTranslated | ||
style={styles.description} | ||
text={description} | ||
/> | ||
|
||
<View style={styles.buttonContainer}> | ||
<ReadMoreButton | ||
buttonStyle={styles.button} | ||
buttonTextStyle={styles.buttonText} | ||
navigateToRoute={Routes.WindesheimTechRadar} | ||
navigationParams={{ page: themeSlug }} | ||
testID={`theme-${themeSlug}-button`} | ||
/> | ||
</View> | ||
</View> | ||
</View> | ||
</IntractableView> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ | ||
import React from 'react'; | ||
|
||
//@ts-ignore | ||
import AmazonLogo from '../../assets/images/WTR/TechProviders/amazon.svg'; | ||
//@ts-ignore | ||
import AppleLogo from '../../assets/images/WTR/TechProviders/apple.svg'; | ||
//@ts-ignore | ||
import CiscoLogo from '../../assets/images/WTR/TechProviders/cisco.svg'; | ||
//@ts-ignore | ||
import GoogleLogo from '../../assets/images/WTR/TechProviders/google.svg'; | ||
//@ts-ignore | ||
import HpLogo from '../../assets/images/WTR/TechProviders/hp.svg'; | ||
//@ts-ignore | ||
import IbmLogo from '../../assets/images/WTR/TechProviders/ibm.svg'; | ||
//@ts-ignore | ||
import IntelLogo from '../../assets/images/WTR/TechProviders/intel.svg'; | ||
//@ts-ignore | ||
import MetaLogo from '../../assets/images/WTR/TechProviders/meta.svg'; | ||
//@ts-ignore | ||
import MicrosoftLogo from '../../assets/images/WTR/TechProviders/microsoft.svg'; | ||
//@ts-ignore | ||
import OpenAILogo from '../../assets/images/WTR/TechProviders/openai.svg'; | ||
//@ts-ignore | ||
import OracleLogo from '../../assets/images/WTR/TechProviders/oracle.svg'; | ||
//@ts-ignore | ||
import SalesForceLogo from '../../assets/images/WTR/TechProviders/salesforce.svg'; | ||
//@ts-ignore | ||
import SapLogo from '../../assets/images/WTR/TechProviders/sap.svg'; | ||
|
||
export type TechProvider = { | ||
name: string; | ||
slug: string; | ||
logo: React.FC<{ width: string; height: string; fill: string }>; | ||
}; | ||
|
||
export enum TechProviderSlug { | ||
Apple = 'apple', | ||
Amazon = 'aws', | ||
Cisco = 'cisco-systems', | ||
Google = 'google', | ||
HP = 'hp', | ||
IBM = 'ibm', | ||
Intel = 'intel', | ||
Meta = 'meta', | ||
Microsoft = 'microsoft', | ||
OpenAI = 'openai', | ||
Oracle = 'oracle', | ||
SalesForce = 'salesforce', | ||
SAP = 'sap', | ||
} | ||
|
||
export const techProviderItems: TechProvider[] = [ | ||
{ name: 'Apple', slug: TechProviderSlug.Apple, logo: AppleLogo }, | ||
{ name: 'Amazon', slug: TechProviderSlug.Amazon, logo: AmazonLogo }, | ||
{ name: 'Cisco', slug: TechProviderSlug.Cisco, logo: CiscoLogo }, | ||
{ name: 'Google', slug: TechProviderSlug.Google, logo: GoogleLogo }, | ||
{ name: 'HP', slug: TechProviderSlug.HP, logo: HpLogo }, | ||
{ name: 'IBM', slug: TechProviderSlug.IBM, logo: IbmLogo }, | ||
{ name: 'Intel', slug: TechProviderSlug.Intel, logo: IntelLogo }, | ||
{ name: 'Meta', slug: TechProviderSlug.Meta, logo: MetaLogo }, | ||
{ | ||
name: 'Microsoft', | ||
slug: TechProviderSlug.Microsoft, | ||
logo: MicrosoftLogo, | ||
}, | ||
{ name: 'OpenAI', slug: TechProviderSlug.OpenAI, logo: OpenAILogo }, | ||
{ name: 'Oracle', slug: TechProviderSlug.Oracle, logo: OracleLogo }, | ||
{ | ||
name: 'SalesForce', | ||
slug: TechProviderSlug.SalesForce, | ||
logo: SalesForceLogo, | ||
}, | ||
{ name: 'SAP', slug: TechProviderSlug.SAP, logo: SapLogo }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.