# 宣導區 📢 > 此區包含不需要實作但值得注意的事情 ### [RN] Style 再標準化 - Clement 說明:移除不必要的樣式並把 `dimens` 也標準化 優點:提高重用率並減少程式碼 可能會遇到的問題: 1. 需要查出所有不必要存在的 style 2. 讓設計師理解標準化的優點 ### [RN] TDD?? - Tom 說明:測試驅動開發 難度::star::star::star::star: 風險::star: 渴望度:11/20 優點:降低bug率 可能會遇到的問題:時程會拉長 ### [RN] RN統一用bigNumber來加減乘除 - Nora 說明:RN統一用bigNumber來加減乘除 論點:較統一,不用Number, parseFloat 解決:RN統一用bigNumber來加減乘除(balance,匯率等都用字串,只有decimal用number) 難度::star: 風險::star: ```javascript= export const formatNumber = (valueString, decimal) => { const valueBN = new BigNumber(valueString); return valueBN.decimalPlaces(decimal, 1).toString(); }; ``` ### [RN] 將style從component拆開 - Nora 說明:將style從component拆開 難度::star: 風險::star: 優點:讓component的程式碼更乾淨,更容易code review 可能會遇到的問題: 渴望度:15/20 參考:https://thoughtbot.com/blog/structure-for-styling-in-react-native  ### [RN] 寫component test - Nora 說明:自己做的component要確定能夠符合每種使用情境,寫測試來確認 難度::star::star::star: 風險::star: 優點:1. 確認component有沒有符合需求 2. 避免別的地方改動影響 可能會遇到的問題:比較花時間 渴望度:15/20 參考: https://reactnative.dev/docs/testing-overview ```javascript= /* AmountCard unit test: balance = 120,000.123456 TRX amount = 9999999.9999 TRX if (balance < amount) -> balance is not enough amount = 9999999 TRX if (balance < amount) -> balance is not enough amount = 0.999999 TRX if (balance >= amount) -> amount must be integer balance = 0.1 TRX if(balance < 1) { press 25%, 50%, 75%, MAX number should be 0 } */ /* transactionDetailCard if(there is no bandwith) -> '委託總額已扣除手續費' should exist if (totoalAsset > 10.shift(9)) { "show more" should exist } ``` ### [RN] 實作流程討論 - Tom 說明:做新的頁面先討論component切法 難度::star: 風險::star: 優點:可以大家一起規劃好怎樣切component 避免重工以及統一切法 可能會遇到的問題:還是會重工
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up