-
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.
- Loading branch information
L
committed
Nov 22, 2021
1 parent
6d078f2
commit 8ee2556
Showing
12 changed files
with
220 additions
and
31 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React, { Component } from 'react' | ||
import { Text, View, StyleSheet } from 'react-native' | ||
|
||
type Props = { | ||
children: React.ReactNode | ||
} | ||
|
||
/** | ||
* @param props {@link Props} | ||
*/ | ||
export const Tag = (props: Props) => { | ||
const { children } = props | ||
return ( | ||
<View style={[styles.tag, styles.tagBrown]}> | ||
<Text>{children}</Text> | ||
</View> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
tags: { | ||
flexDirection: 'row-reverse', | ||
direction: 'rtl', | ||
}, | ||
tag: { | ||
borderWidth: 1, | ||
borderRadius: 10, | ||
paddingVertical: 2, | ||
paddingHorizontal: 6, | ||
textAlign: 'center', | ||
color: 'green', | ||
borderColor: 'green', | ||
fontSize: 12, | ||
marginHorizontal: 2, | ||
}, | ||
tagBrown: { | ||
color: '#6C3512', | ||
borderColor: '#6C3512', | ||
}, | ||
}) |
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 @@ | ||
export * from './Tag' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import React, { Component } from 'react' | ||
import { Text, View, StyleSheet, Image, TouchableOpacity } from 'react-native' | ||
import { useSelector, useDispatch } from 'react-redux' | ||
import { NativeStackNavigationProp } from '@react-navigation/native-stack' | ||
|
||
// import { Button } from '../../components/' | ||
import { RootState } from '../../store' | ||
import { decrement, increment } from './slice' | ||
import { RootStackParamList } from '../../navigation/navigation' | ||
import { Tag } from '../../components' | ||
|
||
type StarProps = { | ||
stars: 1 | 2 | 3 | 4 | 5 | ||
} | ||
|
||
const Stars = ({ stars }: StarProps) => { | ||
return ( | ||
<View style={styles.starsContainer}> | ||
<Text style={styles.stars}>{'★'.repeat(stars)}</Text> | ||
<Text style={[styles.stars, styles.starsGrey]}> | ||
{'★'.repeat(5 - stars)} | ||
</Text> | ||
</View> | ||
) | ||
} | ||
|
||
type Props = { | ||
navigation: NativeStackNavigationProp<RootStackParamList, 'Reviews'> | ||
} | ||
|
||
/** | ||
* @param props {@link Props} | ||
*/ | ||
export default ({ navigation }: Props) => { | ||
const state = useSelector((rootState: RootState) => rootState.reviews) | ||
const dispatch = useDispatch() | ||
|
||
// dispatch(increment); | ||
// let { data, error, isLoading } = useGetPokemonByNameQuery('pikachu') | ||
|
||
return ( | ||
<View style={styles.card}> | ||
<View style={styles.cardHeader}> | ||
<View style={styles.profilePicContainer}> | ||
<Image | ||
source={{ | ||
uri: | ||
'https://www.personality-insights.com/wp-content/uploads/2017/12/default-profile-pic-e1513291410505.jpg', | ||
}} | ||
style={styles.profilePic} | ||
/> | ||
<Image source={require('./facebook.png')} style={styles.socialIcon} /> | ||
</View> | ||
<View style={styles.titleContainer}> | ||
<View style={styles.titleHead}> | ||
<Text style={styles.title}>John Doe</Text> | ||
<Stars stars={4} /> | ||
</View> | ||
<Text style={styles.subtitle}>2 days ago</Text> | ||
</View> | ||
</View> | ||
<Text>Not great</Text> | ||
</View> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
card: { | ||
flex: 1, | ||
backgroundColor: 'white', | ||
padding: 15, | ||
// justifyContent: 'space-between', | ||
// alignItems: 'center', | ||
// flexDirection: 'row', | ||
}, | ||
cardHeader: { | ||
flexDirection: 'row', | ||
}, | ||
profilePic: { | ||
width: 50, | ||
height: 50, | ||
borderRadius: 50, | ||
}, | ||
socialIcon: { | ||
width: 20, | ||
height: 20, | ||
borderRadius: 20, | ||
marginLeft: -15, | ||
}, | ||
profilePicContainer: { | ||
flexDirection: 'row', | ||
alignItems: 'flex-end', | ||
}, | ||
title: { | ||
fontSize: 17, | ||
}, | ||
subtitle: { | ||
color: 'grey', | ||
fontSize: 15, | ||
}, | ||
starsContainer: { | ||
flexDirection: 'row', | ||
paddingHorizontal: 5, | ||
}, | ||
stars: { | ||
fontSize: 11, | ||
color: '#F4B400', | ||
}, | ||
starsGrey: { | ||
color: '#D3D3D3', | ||
}, | ||
titleContainer: { | ||
paddingHorizontal: 7, | ||
marginTop: 3, | ||
flexDirection: 'column', | ||
justifyContent: 'space-around', | ||
}, | ||
titleHead: { | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
}, | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,28 @@ | ||
/* eslint-disable no-param-reassign */ | ||
import { createSlice } from '@reduxjs/toolkit' | ||
|
||
type ReviewsState = { | ||
test: string | ||
} | ||
|
||
const initialState: ReviewsState = { | ||
test: '', | ||
} | ||
|
||
export const slice = createSlice({ | ||
name: 'reviews', | ||
initialState, | ||
reducers: { | ||
increment: (state: ReviewsState) => { | ||
state.test = 'test-increment' | ||
}, | ||
decrement: (state: ReviewsState) => { | ||
state.test = 'test-decrement' | ||
}, | ||
}, | ||
}) | ||
|
||
// Action creators are generated for each case reducer function | ||
export const { increment, decrement } = slice.actions | ||
|
||
export default slice.reducer |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Parameters for each screen | ||
export type RootStackParamList = { | ||
Menu: undefined | ||
Reviews: undefined | ||
} |
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