프로젝트/[react]weather_app
[weather_app_6] 아이콘 변경, 앱 제작 완료
samsaraA
2018. 5. 1. 16:13
이전 제작에 문제가 된 Mist, Haze 상태 추가
ionicon 대신 material community icons를 불러오자
import { MaterialCommunityIcons } from "@expo/vector-icons";
<MaterialCommunityIcons color="white" size={144} name={weatherCases[weatherName].icon} />
새로운 아이콘네임으로 변경
const weatherCases = {
Rain: {
colors:["#00C6FB", "#005BEA"],
title: "Raining",
subtitle: "우산 챙기세요",
icon: "weather-rainy"
},
Clear: {
colors:["#FEF253", "#FF7300"],
title: "Sunny",
subtitle: "날이 좋아요",
icon: "weather-sunny"
},
Thunderstorm: {
colors:["#00ECBC", "#007ADF"],
title: "Thunderstrom",
subtitle: "천둥이쳐요!",
icon: "weather-lightening"
},
Clouds: {
colors:["#D7D2CC", "#304352"],
title: "Clouds",
subtitle: "구름이 꼈어요",
icon: "weather-cloudy"
},
Snow: {
colors:["#7DE2FC", "#B9B6E5"],
title: "Snow",
subtitle: "눈이와요!",
icon: "weather-snowy"
},
Drizzle: {
colors:["#89F7FE", "#66A6FF"],
title: "Drizzle",
subtitle: "이슬비가 내려요",
icon: "weather-hail"
},
Haze: {
colors:["#89F7FE", "#66A6FF"],
title: "Haze",
subtitle: "안개가 꼈어요",
icon: "weather-hail"
},
Mist: {
colors:["#D7D2CC", "#304352"],
title: "Mist",
subtitle: "안개가 꼈어요",
icon: "weather-fog"
}
}
완성 코드가 담긴 깃허브 !
https://github.com/samsara1019/weatherApp