Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cases] CaseScreen bugs #82

Merged
merged 21 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5746d54
fix: change activeText color
arfamomin Apr 11, 2024
3b968c9
fix: make entire StatusUpdatesBar clickable
arfamomin Apr 14, 2024
1c58e40
fix: update warning icon
arfamomin Apr 14, 2024
0237b77
fix: dates for form items
arfamomin Apr 14, 2024
ab9ce18
Merge branch 'main' of https://github.com/calblueprint/impact-fund in…
ronniebeggs Apr 17, 2024
1cd79cb
fix: remove random file
arfamomin Apr 18, 2024
27595cb
fix: investigating date stuff (not done)
arfamomin Apr 21, 2024
5d81a35
fix: pressable req padding
arfamomin Apr 21, 2024
5855ca8
fix: view all updates alignment
arfamomin Apr 21, 2024
720333f
fix: cleaned up status button containers
arfamomin Apr 21, 2024
6eeced0
fix: typing and enumming status options
arfamomin Apr 21, 2024
c040cb5
fix: resolved philips pr review comments
arfamomin Apr 23, 2024
49a6439
fix: change padding from % to pixel
arfamomin Apr 23, 2024
0d1dab4
Merge branch 'arfamomin/imp-82-casescreen-bugs' of https://github.com…
ronniebeggs Apr 24, 2024
2a40a5a
[feat] create a global shadow style and apply it to all containers wi…
ronniebeggs Apr 24, 2024
1c81c32
[cleanup] remove comments.
ronniebeggs Apr 24, 2024
9b84a5a
[refactor] apply shadows in other places.
ronniebeggs Apr 24, 2024
bc49d0a
[cleanup] simplify date function
ronniebeggs Apr 24, 2024
ea99dda
cleanup: simplify getStatus function
arfamomin Apr 24, 2024
fb16185
[cleanup] apply shadow to UpdateView
arfamomin Apr 24, 2024
d946032
[fix] fix style order on updates screen to override default shadow bo…
ronniebeggs Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/red-warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/Components/CaseCard/CaseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import {
formatDate,
getStatusColor,
} from '../../app/(BottomTabNavigation)/AllCases/utils';
import globalStyles from '../../styles/global';
import { Case } from '../../types/types';

function CaseCard(caseData: Case) {
const statusColor = getStatusColor(caseData.caseStatus);
return (
<TouchableOpacity
style={styles.caseCard}
style={[styles.caseCard, globalStyles.shadowBorder]}
onPress={() =>
router.push({
pathname: `/AllCases/CaseScreen/${caseData.id}`,
Expand Down
10 changes: 0 additions & 10 deletions src/Components/CaseCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ export default StyleSheet.create({
width: '100%',
flexDirection: 'column',
paddingHorizontal: 20,

backgroundColor: colors.white,
border: 'solid',
borderColor: colors.darkGrey,
borderWidth: 0.25,
borderRadius: 5,
shadowOffset: { width: 0.05, height: 0.75 },
shadowOpacity: 1.25,
shadowRadius: 0.05,
elevation: 1,
},
mainContentContainer: {
flexDirection: 'row',
Expand Down
4 changes: 3 additions & 1 deletion src/Components/CaseStatusBar/CaseStatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import { View, Text } from 'react-native';

import styles from './styles';
import { getStatusColor } from '../../app/(BottomTabNavigation)/AllCases/utils';
import globalStyles from '../../styles/global';

interface CaseStatusBarProps {
status: string;
}

export default function CaseStatusBar({ status }: CaseStatusBarProps) {
const statusColor = getStatusColor(status);
return (
<View style={styles.container}>
<View style={[styles.container, globalStyles.shadowBorder]}>
<Text style={styles.statusText}>Case Status:</Text>
<View style={[styles.statusContainer, statusColor.background]}>
<Text style={[styles.statusTextColor, statusColor.text]}>{status}</Text>
Expand Down
12 changes: 0 additions & 12 deletions src/Components/CaseStatusBar/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,7 @@ export default StyleSheet.create({
alignItems: 'center',
flexDirection: 'row',
justifyContent: 'space-between',
backgroundColor: colors.white,
paddingHorizontal: 20,

borderWidth: 0.5,
borderRadius: 5,
borderStyle: 'solid',
borderColor: colors.midGrey,

shadowColor: colors.black,
shadowOffset: { width: 0.05, height: 0.75 },
shadowOpacity: 1.25,
shadowRadius: 0.05,
elevation: 1,
},
statusContainer: {
height: 29,
Expand Down
3 changes: 2 additions & 1 deletion src/Components/CaseSummaryCard/CaseSummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { View, Text, TouchableOpacity } from 'react-native';
import styles from './styles';
import RightCaret from '../../../assets/right-caret.svg';
import { formatDate } from '../../app/(BottomTabNavigation)/AllCases/utils';
import globalStyles from '../../styles/global';
import { CaseSummaryProps } from '../../types/types';

export default function CaseSummaryCard({
Expand All @@ -23,7 +24,7 @@ export default function CaseSummaryCard({
});
}}
>
<View style={styles.container}>
<View style={[styles.container, globalStyles.shadowBorder]}>
<Image
style={styles.imageContainer}
source={imageUrl}
Expand Down
10 changes: 0 additions & 10 deletions src/Components/CaseSummaryCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ export default StyleSheet.create({
container: {
width: '100%',
flexDirection: 'column',
borderWidth: 0.5,
borderRadius: 5,
borderStyle: 'solid',
borderColor: colors.midGrey,
backgroundColor: colors.white,
shadowColor: colors.black,
shadowOffset: { width: 0.05, height: 0.75 },
shadowOpacity: 1.25,
shadowRadius: 0.05,
elevation: 1,
},
imageContainer: {
aspectRatio: 1.9,
Expand Down
3 changes: 2 additions & 1 deletion src/Components/EducationalBar/EducationalBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import styles from './styles';
import RedInformationIcon from '../../../assets/red-information-icon.svg';
import RightCarrot from '../../../assets/right-caret.svg';
import { openUrl } from '../../app/(BottomTabNavigation)/AllCases/utils';
import globalStyles from '../../styles/global';

export default function EducationalBar() {
return (
<View style={styles.container}>
<View style={[styles.container, globalStyles.shadowBorder]}>
<TouchableOpacity
onPress={() => openUrl('https://www.impactfund.org/')}
style={styles.button}
Expand Down
7 changes: 2 additions & 5 deletions src/Components/EducationalBar/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import { colors } from '../../styles/colors';
export default StyleSheet.create({
container: {
width: '100%',
display: 'flex',
height: 55,
paddingHorizontal: 20,
borderWidth: 0.5,
borderRadius: 5,
borderColor: colors.darkGrey,
display: 'flex',
flexDirection: 'row',
paddingHorizontal: 20,
},
button: {
width: '100%',
Expand Down
7 changes: 4 additions & 3 deletions src/Components/EligibilityCard/EligibilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Fileclaim from '../../../assets/file-claim.svg';
import Arrow from '../../../assets/next.svg';
import OptOut from '../../../assets/opt-out.svg';
import { openUrl } from '../../app/(BottomTabNavigation)/AllCases/utils';
import globalStyles from '../../styles/global';
import { Case, Eligibility } from '../../types/types';

interface EligibilityCardProps {
Expand All @@ -35,7 +36,7 @@ export default function EligibilityCard({
return (
<View style={styles.container}>
<TouchableOpacity
style={styles.buttonContainer}
style={[styles.buttonContainer, globalStyles.shadowBorder]}
onPress={() => {
router.push({
pathname: `/AllCases/EligibilityForm/${caseData.id}`,
Expand Down Expand Up @@ -67,7 +68,7 @@ export default function EligibilityCard({
return (
<View style={styles.container}>
<TouchableOpacity
style={styles.buttonContainer}
style={[styles.buttonContainer, globalStyles.shadowBorder]}
onPress={onPressHandler}
>
<View style={styles.leftContainer}>
Expand All @@ -94,7 +95,7 @@ export default function EligibilityCard({
</View>

<TouchableOpacity
style={styles.buttonContainer}
style={[styles.buttonContainer, globalStyles.shadowBorder]}
onPress={() => {
router.push({
pathname: `/AllCases/OptOut/${caseData.id}`,
Expand Down
12 changes: 0 additions & 12 deletions src/Components/EligibilityCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ export default StyleSheet.create({
alignSelf: 'center',
justifyContent: 'space-evenly',
padding: 20,
backgroundColor: colors.white,

border: 'solid',
borderWidth: 0.5,
borderRadius: 5,
borderColor: colors.midGrey,

shadowColor: colors.black,
shadowOffset: { width: 0.05, height: 0.75 },
shadowOpacity: 1.25,
shadowRadius: 0.05,
elevation: 1,
},
leftContainer: {
flex: 0.15,
Expand Down
3 changes: 2 additions & 1 deletion src/Components/FormsCard/FormsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { View, Text, TouchableOpacity } from 'react-native';
import styles from './styles';
import RightCaret from '../../../assets/right-caret.svg';
import { getFeaturedForm } from '../../app/(BottomTabNavigation)/AllCases/Forms/utils';
import globalStyles from '../../styles/global';
import { Case, Form } from '../../types/types';
import FormListItem from '../FormListItem/FormListItem';

Expand All @@ -28,7 +29,7 @@ export default function FormsCard(caseData: Case) {
}, []);

return (
<View style={styles.container}>
<View style={[styles.container, globalStyles.shadowBorder]}>
<View style={styles.topContainer}>
<Text style={styles.titleText}>Documents</Text>
<TouchableOpacity
Expand Down
3 changes: 0 additions & 3 deletions src/Components/FormsCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export default StyleSheet.create({
alignItems: 'center',
rowGap: 12,
paddingVertical: 23,
borderWidth: 0.5,
borderRadius: 5,
borderColor: colors.darkGrey,
},
topContainer: {
height: 32,
Expand Down
10 changes: 5 additions & 5 deletions src/Components/PressableRequirement/styles.ts
arfamomin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { colors } from '../../styles/colors';
export default StyleSheet.create({
requirementContainer: {
flexDirection: 'row',
paddingTop: 20,
columnGap: 20,
paddingHorizontal: '6%',
paddingHorizontal: 25,
paddingVertical: 20,
},
innerRequirementBox: {
flex: 1,
paddingBottom: 20,
justifyContent: 'center',
},
buttonBase: {
flexDirection: 'row',
Expand All @@ -29,9 +29,9 @@ export default StyleSheet.create({
fontWeight: '300',
},
activeText: {
color: colors.black,
color: colors.darkGrey,
},
inactiveText: {
color: colors.midGrey,
color: colors.black,
},
});
25 changes: 14 additions & 11 deletions src/Components/StatusUpdatesBar/StatusUpdatesBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { View, Text, TouchableOpacity } from 'react-native';
import styles from './styles';
import RightCaret from '../../../assets/right-caret.svg';
import { getStatusColor } from '../../app/(BottomTabNavigation)/AllCases/utils';
import globalStyles from '../../styles/global';
import { CaseUid } from '../../types/types';

interface CaseStatusBarProps {
Expand All @@ -19,22 +20,24 @@ export default function StatusUpdatesBar({
const statusColor = getStatusColor(status);

return (
<View style={styles.container}>
<View style={styles.topContainer}>
<TouchableOpacity
style={[styles.updatesButton, globalStyles.shadowBorder]}
onPress={() => {
router.push({ pathname: `AllCases/Updates/${caseUid}` });
}}
>
<View style={styles.textContainer}>
<Text style={styles.statusText}>Case Status:</Text>
<TouchableOpacity
style={styles.updatesButton}
onPress={() => {
router.push({ pathname: `AllCases/Updates/${caseUid}` });
}}
>

<View style={styles.updatesContainer}>
<Text style={styles.buttonText}>View all updates</Text>
<RightCaret />
</TouchableOpacity>
<RightCaret style={styles.icon} />
</View>
</View>

<View style={[styles.statusContainer, statusColor.background]}>
<Text style={[styles.statusTextColor, statusColor.text]}>{status}</Text>
</View>
</View>
</TouchableOpacity>
);
}
30 changes: 9 additions & 21 deletions src/Components/StatusUpdatesBar/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,15 @@ import { StyleSheet } from 'react-native';

import { colors } from '../../styles/colors';
export default StyleSheet.create({
container: {
// height: ,
updatesButton: {
width: '100%',
alignItems: 'center',
flexDirection: 'column',
justifyContent: 'space-between',
backgroundColor: colors.white,
// paddingHorizontal: 20,
padding: 16,
rowGap: 10,

borderWidth: 0.5,
borderRadius: 5,
borderStyle: 'solid',
borderColor: colors.midGrey,

shadowColor: colors.black,
shadowOffset: { width: 0.05, height: 0.75 },
shadowOpacity: 1.25,
shadowRadius: 0.05,
elevation: 1,
},
topContainer: {
textContainer: {
width: '100%',
height: 31,
flexDirection: 'row',
Expand All @@ -34,11 +20,6 @@ export default StyleSheet.create({
borderBottomWidth: 0.5,
borderBottomColor: colors.midGrey,
},
updatesButton: {
flexDirection: 'row',
alignItems: 'center',
columnGap: 16,
},
statusContainer: {
height: 29,
width: '100%',
Expand All @@ -49,6 +30,10 @@ export default StyleSheet.create({
borderWidth: 0.3,
borderRadius: 5,
},
updatesContainer: {
flexDirection: 'row',
columnGap: 10,
},
statusText: {
fontSize: 20,
lineHeight: 21,
Expand All @@ -68,4 +53,7 @@ export default StyleSheet.create({
fontWeight: '300',
lineHeight: 21,
},
icon: {
marginTop: 5,
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { View, Text, TouchableOpacity, FlatList } from 'react-native';

import styles from './styles';
import Check from '../../../../../assets/check-circle.svg';
import Error from '../../../../../assets/exclamation.svg';
import RedWarning from '../../../../../assets/red-warning.svg';
import Ex from '../../../../../assets/x.svg';
import PressableRequirement from '../../../../Components/PressableRequirement/PressableRequirement';
import {
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function EligibilityForm() {
transition={300}
/>
<View style={styles.infoRow}>
<Error />
<RedWarning />
<View style={{ flex: 1 }}>
<Text style={styles.bodyText}>
You must meet every requirement to be eligible for this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { View, Text, ScrollView } from 'react-native';

import styles from './styles';
import NotificationBell from '../../../../../../assets/red-notification-bell.svg';
import globalStyles from '../../../../../styles/global';
import { getUpdateById } from '../../../../../supabase/queries/updates';
import { Update, UpdateUid } from '../../../../../types/types';
import { formatDate } from '../../utils';
Expand Down Expand Up @@ -35,7 +36,7 @@ export default function UpdateView() {
style={styles.outerScroll}
showsVerticalScrollIndicator={false}
>
<View style={styles.innerScroll}>
<View style={[globalStyles.shadowBorder, styles.innerScroll]}>
<View style={styles.titleContainer}>
<NotificationBell />
<View style={styles.headerText}>
Expand Down
Loading
Loading