Skip to content

Commit

Permalink
fix: 안드로이드 그림자를 반영 #1 #2 #5
Browse files Browse the repository at this point in the history
  • Loading branch information
arch-spatula committed Jan 12, 2023
1 parent 57eb2b9 commit ebbdba0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
22 changes: 20 additions & 2 deletions src/components/ManageList.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/native';
import { COLORS } from '../shared/color';
import { Alert } from 'react-native';
import { Alert, StyleSheet } from 'react-native';
import { useDeletePillData } from '../Hooks/usePill';
import TextButton from './TextButton';

Expand Down Expand Up @@ -28,7 +28,7 @@ const ManageList = ({ id, pillName, time, navigate }) => {
};

return (
<ManageListContainer>
<ManageListContainer style={styles.list}>
<ManageListTitle>{pillName}</ManageListTitle>
<ButtonGroupContainer>
<TextButton
Expand Down Expand Up @@ -81,4 +81,22 @@ const ButtonGroupContainer = styled.View`
gap: 16px;
`;

const styles = StyleSheet.create({
list: {
...Platform.select({
ios: {
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.23,
},
android: {
elevation: 4,
},
}),
},
});

export default ManageList;
21 changes: 20 additions & 1 deletion src/components/ToggleList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { COLORS } from '../shared/color';
import styled from '@emotion/native';
import ToggleButton from './ToggleButton';
import { strToObjTime, translateTime } from '../utils/transTime';
import { StyleSheet } from 'react-native';

// TODO: 조건부 스타일링 isTaken값이 false랑 true에 따라 다른 UI가 보입니다.
const ToggleList = ({ pillName, time, id, isTaken, uid }) => {
Expand All @@ -10,7 +11,7 @@ const ToggleList = ({ pillName, time, id, isTaken, uid }) => {
const mainPageTime = translateTime(objTime);

return (
<ToggleListItem isTaken={isTaken}>
<ToggleListItem style={styles.list} isTaken={isTaken}>
<ToggleListItemTextContainer>
<ToggleListItemTitle>{pillName}</ToggleListItemTitle>
<ToggleListItemTime>{mainPageTime}</ToggleListItemTime>
Expand Down Expand Up @@ -49,4 +50,22 @@ const ToggleListItemTime = styled.Text`
text-overflow: ellipsis;
`;

const styles = StyleSheet.create({
list: {
...Platform.select({
ios: {
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.23,
},
android: {
elevation: 4,
},
}),
},
});

export default ToggleList;

0 comments on commit ebbdba0

Please sign in to comment.