Skip to content

Commit

Permalink
[CHORE] #16 : raw text -> string resource로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Oct 13, 2023
1 parent 1fb2287 commit dc63f51
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.wap.designsystem.WappTheme
import com.wap.wapp.feature.auth.R

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand All @@ -46,15 +48,15 @@ fun signInBottomSheet() {
) {
Text(
modifier = Modifier.align(Alignment.CenterHorizontally),
text = "로그인",
text = stringResource(id = R.string.sign_in),
style = WappTheme.typography.contentMedium,
color = WappTheme.colors.white,
)

Spacer(modifier = Modifier.height(16.dp))

Text(
text = "이메일",
text = stringResource(id = R.string.sign_in_email),
color = WappTheme.colors.white,
style = WappTheme.typography.labelRegular,
)
Expand All @@ -64,7 +66,9 @@ fun signInBottomSheet() {
value = filledText,
onValueChange = { filledText = it },
placeholder = {
Text(text = "Github Email")
Text(
text = stringResource(id = R.string.sign_in_email_hint),
)
},
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Email,
Expand All @@ -83,7 +87,7 @@ fun signInBottomSheet() {
shape = RoundedCornerShape(10.dp),
) {
Text(
text = "완료",
text = stringResource(id = R.string.done),
style = WappTheme.typography.contentMedium,
)
}
Expand All @@ -97,7 +101,7 @@ fun signInBottomSheet() {
Text(
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center,
text = "이메일을 까먹었으셨나요?",
text = stringResource(id = R.string.sign_in_find_email),
style = WappTheme.typography.captionMedium,
color = WappTheme.colors.yellow,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.wap.designsystem.WappTheme
import com.wap.wapp.core.designresource.R
import com.wap.wapp.feature.auth.R.string

@Composable
fun SignInScreen(
Expand All @@ -43,10 +45,10 @@ fun SignInScreen(
) {
Spacer(modifier = Modifier.height(32.dp))
Image(
painter = painterResource(id = R.drawable.img_white_cat),
modifier = Modifier
.align(Alignment.CenterHorizontally)
.size(width = 230.dp, height = 230.dp),
painter = painterResource(id = R.drawable.ic_white_cat),
contentDescription = "WAPP ICON",
)

Expand All @@ -56,14 +58,14 @@ fun SignInScreen(
Column {
Spacer(modifier = Modifier.height(40.dp))
Text(
text = "WAPP",
text = stringResource(id = string.application_name),
style = WappTheme.typography.titleBold,
fontSize = 48.sp,
color = WappTheme.colors.white,
)
}
Text(
text = "WAPP",
text = stringResource(id = string.application_name),
fontSize = 48.sp,
style = WappTheme.typography.titleBold,
color = WappTheme.colors.yellow,
Expand All @@ -83,13 +85,15 @@ fun SignInScreen(
) {
Icon(
painter = painterResource(id = R.drawable.ic_github),
contentDescription = "Github SignIn Icon",
contentDescription = stringResource(
id = string.sign_in_github_description,
),
modifier = Modifier.size(40.dp),
tint = WappTheme.colors.black,
)
Spacer(modifier = Modifier.width(16.dp))
Text(
text = "Github 로그인",
text = stringResource(id = string.sign_in_github_content),
style = WappTheme.typography.contentMedium,
)
}
Expand All @@ -112,12 +116,14 @@ fun SignInScreen(
) {
Icon(
painter = painterResource(id = R.drawable.ic_balloon),
contentDescription = "Balloon Icon",
contentDescription = stringResource(
id = string.sign_in_non_member_description,
),
modifier = Modifier.size(40.dp),
)
Spacer(modifier = Modifier.width(16.dp))
Text(
text = "비회원으로 둘러보기",
text = stringResource(id = string.sign_in_non_member_content),
style = WappTheme.typography.contentMedium,
color = WappTheme.colors.white,
)
Expand All @@ -131,8 +137,8 @@ fun SignInScreen(
@Preview
@Composable
fun previewSignInScreen() {
/*SignInScreen(
navigateToSignUp = { }
SignInScreen(
navigateToSignUp = { },
navigateToNotice = { },
)*/
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.wap.wapp.feature.auth.signup

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.material.Text
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.wap.designsystem.WappTheme

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SignUpChipGroup() {
val itemsList = listOf("1학기", "2학기")

var selectedItem by remember {
mutableStateOf(itemsList[0]) // initially, first item is selected
}

LazyRow(modifier = Modifier.fillMaxWidth()) {
items(itemsList) { item ->
FilterChip(
modifier = Modifier.padding(horizontal = 6.dp),
selected = (item == selectedItem),
onClick = {
selectedItem = item
},
label = {
Text(
text = item,
color = WappTheme.colors.white,
style = WappTheme.typography.contentRegular,
textAlign = TextAlign.Center,
)
},
colors = FilterChipDefaults.filterChipColors(
containerColor = WappTheme.colors.black3,
selectedContainerColor = WappTheme.colors.yellow,
),
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.Icon
Expand All @@ -23,24 +21,21 @@ import androidx.compose.material.TextField
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.wap.designsystem.WappTheme
import com.wap.wapp.core.designresource.R
import com.wap.wapp.feature.auth.R.drawable.ic_card
import com.wap.wapp.feature.auth.R.drawable.ic_door
import com.wap.wapp.feature.auth.R.string

@Composable
fun SignUpScreen() {
Expand All @@ -59,13 +54,13 @@ fun SignUpScreen() {
) {
Image(
painterResource(id = R.drawable.ic_back_btn),
contentDescription = "Back Button",
contentDescription = stringResource(id = string.back_button_description),
modifier = Modifier
.padding(vertical = 16.dp)
.size(20.dp),
)
Text(
text = "회원가입",
text = stringResource(id = string.sign_up),
style = WappTheme.typography.titleBold,
color = WappTheme.colors.white,
fontSize = 20.sp,
Expand All @@ -79,12 +74,12 @@ fun SignUpScreen() {
Spacer(modifier = Modifier.height(32.dp))

Text(
text = "처음 가입하시네요!",
text = stringResource(id = string.sign_up_title),
style = WappTheme.typography.titleBold,
color = WappTheme.colors.white,
)
Text(
text = "회원님의 정보를 입력해주세요.",
text = stringResource(id = string.sign_up_content),
style = WappTheme.typography.contentMedium,
color = WappTheme.colors.gray1,
)
Expand All @@ -95,17 +90,23 @@ fun SignUpScreen() {
verticalArrangement = Arrangement.spacedBy(32.dp),
) {
SignUpTextField(
fieldName = "이름",
fieldHint = "이름을 입력해주세요.",
fieldSupportingText = "회원 확인을 위해, 실명을 입력해주세요.",
iconDescription = stringResource(id = string.sign_up_name_description),
fieldName = stringResource(id = string.sign_up_name_title),
fieldHint = stringResource(id = string.sign_up_name_hint),
fieldSupportingText = stringResource(id = string.sign_up_name_caption),
fieldIcon = R.drawable.ic_profile,
)

SignUpTextField(
fieldName = "학번",
fieldHint = "학번을 입력해주세요.",
fieldSupportingText = "동명이인을 구별하기 위해, 필요해요!",
fieldIcon = R.drawable.ic_card,
iconDescription = stringResource(
id = string.sign_up_student_id_description,
),
fieldName = stringResource(id = string.sign_up_student_id_title),
fieldHint = stringResource(id = string.sign_up_student_id_hint),
fieldSupportingText = stringResource(
id = string.sign_up_student_id_caption,
),
fieldIcon = ic_card,
)

var dummyText = ""
Expand All @@ -114,14 +115,16 @@ fun SignUpScreen() {
verticalAlignment = Alignment.CenterVertically,
) {
Icon(
painter = painterResource(id = R.drawable.ic_door),
contentDescription = "name Icon",
painter = painterResource(id = ic_door),
contentDescription = stringResource(
id = string.sign_up_registered_at_description,
),
tint = WappTheme.colors.white,
modifier = Modifier.size(20.dp),
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = "입부시기",
text = stringResource(id = string.sign_up_registered_at_title),
color = WappTheme.colors.white,
style = WappTheme.typography.contentBold,
)
Expand All @@ -143,7 +146,9 @@ fun SignUpScreen() {
),
placeholder = {
Text(
text = "입부년도 입력",
text = stringResource(
id = string.sign_up_registered_at_hint,
),
color = WappTheme.colors.gray1,
)
},
Expand All @@ -159,7 +164,7 @@ fun SignUpScreen() {

Spacer(modifier = Modifier.height(8.dp))
Text(
text = "회원님의 기수 정보를 알려드릴게요!",
text = stringResource(id = string.sign_up_registered_at_caption),
color = WappTheme.colors.yellow,
style = WappTheme.typography.captionRegular,
)
Expand All @@ -174,7 +179,7 @@ fun SignUpScreen() {
shape = RoundedCornerShape(10.dp),
) {
Text(
text = "완료",
text = stringResource(id = string.done),
style = WappTheme.typography.contentMedium,
color = WappTheme.colors.white,
)
Expand All @@ -185,40 +190,6 @@ fun SignUpScreen() {
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SignUpChipGroup() {
val itemsList = listOf("1학기", "2학기")

var selectedItem by remember {
mutableStateOf(itemsList[0]) // initially, first item is selected
}

LazyRow(modifier = Modifier.fillMaxWidth()) {
items(itemsList) { item ->
FilterChip(
modifier = Modifier.padding(horizontal = 6.dp),
selected = (item == selectedItem),
onClick = {
selectedItem = item
},
label = {
Text(
text = item,
color = WappTheme.colors.white,
style = WappTheme.typography.contentRegular,
textAlign = TextAlign.Center,
)
},
colors = FilterChipDefaults.filterChipColors(
containerColor = WappTheme.colors.black3,
selectedContainerColor = WappTheme.colors.yellow,
),
)
}
}
}

@Preview
@Composable
fun previewSignUpScreen() {
Expand Down
Loading

0 comments on commit dc63f51

Please sign in to comment.