Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into refactor/#212-dialog
Browse files Browse the repository at this point in the history
# Conflicts:
#	feature/src/main/java/com/terning/feature/intern/component/InternInfoRow.kt
  • Loading branch information
boiledEgg-s committed Sep 6, 2024
2 parents 571e43e + a6569b5 commit 52e6c48
Show file tree
Hide file tree
Showing 78 changed files with 1,633 additions and 1,516 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dokka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ jobs:
- name: Set Local Properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
TEST_BASE_URL: ${{ secrets.TEST_BASE_URL }}
NATIVE_APP_KEY: ${{ secrets.NATIVE_APP_KEY }}
NATIVEAPPKEY: ${{ secrets.NATIVEAPPKEY }}
run: |
echo base.url=\"$BASE_URL\" >> local.properties
echo test.base.url=\"$TEST_BASE_URL\" >> local.properties
echo native.app.key=\"$NATIVE_APP_KEY\" >> local.properties
echo nativeAppKey=\"$NATIVEAPPKEY\" >> local.properties
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/pr_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,11 @@ jobs:
- name: Access Local Properties
env:
base_url: ${{ secrets.BASE_URL }}
TEST_BASE_URL: ${{ secrets.TEST_BASE_URL }}
NATIVE_APP_KEY: ${{ secrets.NATIVE_APP_KEY }}
NATIVEAPPKEY: ${{ secrets.NATIVEAPPKEY }}
run: |
echo base.url=\"$base_url\" >> local.properties
echo base.url=\"$base_url\" >> local.properties
echo test.base.url=\"$TEST_BASE_URL\" >> local.properties
echo native.app.key=\"$NATIVE_APP_KEY\" >> local.properties
echo nativeAppKey=\"$NATIVEAPPKEY\" >> local.properties
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
buildConfigField(
"String",
"BASE_URL",
gradleLocalProperties(rootDir, providers).getProperty("base.url")
gradleLocalProperties(rootDir, providers).getProperty("test.base.url")
)
}
release {
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/terning/point/di/AuthInterceptor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class AuthInterceptor @Inject constructor(
override fun intercept(chain: Interceptor.Chain): Response {
val originalRequest = chain.request()

Timber.d("GET REFRESH TOKEN : ${terningDataStore.refreshToken}")
Timber.d("GET ACCESS TOKEN : ${terningDataStore.accessToken}")

val authRequest = if (terningDataStore.refreshToken.isNotBlank()) {
val authRequest = if (terningDataStore.accessToken.isNotBlank()) {
originalRequest.newBuilder().newAuthBuilder().build()
} else {
originalRequest
Expand All @@ -45,7 +45,7 @@ class AuthInterceptor @Inject constructor(
)
}.onSuccess { data ->
terningDataStore.apply {
refreshToken = data.refreshToken
accessToken = data.accessToken
}

response.close()
Expand Down Expand Up @@ -77,7 +77,7 @@ class AuthInterceptor @Inject constructor(
}

private fun Request.Builder.newAuthBuilder() =
this.addHeader(AUTHORIZATION, "$BEARER ${terningDataStore.refreshToken}")
this.addHeader(AUTHORIZATION, "$BEARER ${terningDataStore.accessToken}")

companion object {
private const val CODE_TOKEN_EXPIRED = 401
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.terning.core.designsystem.component.bottomsheet

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
Expand Down Expand Up @@ -41,18 +43,20 @@ fun MyPageLogoutBottomSheet(
content = {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = modifier
) {
Spacer(modifier = modifier.height(10.dp))
Text(
text = stringResource(id = R.string.my_page_bottom_sheet_title),
style = TerningTheme.typography.heading1,
modifier = modifier.padding(top = 35.dp)
)
Spacer(modifier = modifier.height(60.dp))
Text(
text = stringResource(id = R.string.my_page_logout_sub),
style = TerningTheme.typography.body4,
color = Grey400,
modifier = modifier.padding(top = 54.dp)
)
Spacer(modifier = modifier.height(64.dp))
RoundButton(
style = TerningTheme.typography.button2,
paddingVertical = 15.dp,
Expand All @@ -63,10 +67,10 @@ fun MyPageLogoutBottomSheet(
},
modifier = modifier.padding(
start = 24.dp,
top = 72.dp,
end = 24.dp
),
)
Spacer(modifier = modifier.height(8.dp))
DeleteRoundButton(
style = TerningTheme.typography.button2,
paddingVertical = 15.dp,
Expand All @@ -82,11 +86,10 @@ fun MyPageLogoutBottomSheet(
},
modifier = modifier.padding(
start = 24.dp,
top = 8.dp,
end = 24.dp,
bottom = 100.dp
)
)
Spacer(modifier = modifier.height(32.dp))
}
},
onDismissRequest = { onDismiss() },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.terning.core.designsystem.component.bottomsheet

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Text
Expand Down Expand Up @@ -42,19 +44,21 @@ fun MyPageQuitBottomSheet(
content = {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = modifier
) {
Spacer(modifier = modifier.height(10.dp))
Text(
text = stringResource(id = R.string.my_page_bottom_sheet_title),
style = TerningTheme.typography.heading1,
modifier = modifier.padding(top = 14.dp)
)
Spacer(modifier = modifier.height(28.dp))
Text(
text = stringResource(id = R.string.my_page_quit_sub),
style = TerningTheme.typography.body3,
modifier = modifier.padding(top = 54.dp),
textAlign = TextAlign.Center,
color = Grey400
)
Spacer(modifier = modifier.height(36.dp))
RoundButton(
style = TerningTheme.typography.button2,
paddingVertical = 15.dp,
Expand All @@ -63,12 +67,12 @@ fun MyPageQuitBottomSheet(
onButtonClick = {
onQuitClick()
},
modifier = modifier.padding(
modifier = Modifier.padding(
start = 24.dp,
top = 41.dp,
end = 24.dp
)
)
Spacer(modifier = modifier.height(8.dp))
DeleteRoundButton(
style = TerningTheme.typography.button2,
paddingVertical = 15.dp,
Expand All @@ -82,13 +86,12 @@ fun MyPageQuitBottomSheet(
}
}
},
modifier = modifier.padding(
modifier = Modifier.padding(
start = 24.dp,
top = 8.dp,
end = 24.dp,
bottom = 100.dp
)
)
Spacer(modifier = modifier.height(32.dp))
}
},
onDismissRequest = { onDismiss() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.itemsIndexed
Expand All @@ -17,7 +18,6 @@ import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
Expand All @@ -27,14 +27,13 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.terning.core.R
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.extension.noRippleClickable
import kotlinx.coroutines.launch

/**
* ํšŒ์›๊ฐ€์ž…์„ ํ•  ๋•Œ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐ”ํ…€์‹œํŠธ์ž…๋‹ˆ๋‹ค.
* ํ”„๋กœํ•„ ์ด๋ฏธ์ง€๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐ”ํ…€์‹œํŠธ์ž…๋‹ˆ๋‹ค.
*
* @param modifier ๋ฐ”ํ…€์‹œํŠธ์— ์ ์šฉํ•  Modifier์ž…๋‹ˆ๋‹ค.
* @param onDismiss ๋ฐ”ํ…€์‹œํŠธ๊ฐ€ ๋‹ซํž ๋•Œ ํ˜ธ์ถœ๋˜๋Š” ์ฝœ๋ฐฑ ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค.
Expand All @@ -43,7 +42,7 @@ import kotlinx.coroutines.launch
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SignUpBottomSheet(
fun ProfileBottomSheet(
modifier: Modifier = Modifier,
onDismiss: () -> Unit,
onSaveClick: (Int) -> Unit,
Expand All @@ -52,43 +51,30 @@ fun SignUpBottomSheet(
val scope = rememberCoroutineScope()
val sheetState = rememberModalBottomSheetState()

var selectedImageIndex by remember { mutableIntStateOf(initialSelectedOption) }

TerningBasicBottomSheet(
content = {
Column {
Column(modifier = modifier) {
Text(
text = stringResource(id = R.string.sign_up_bottom_sheet_title),
style = TerningTheme.typography.title2,
modifier = modifier
modifier = Modifier
.padding(
start = 28.dp,
bottom = 25.dp
bottom = 20.dp
),
)
RadioButtonGroup(
onOptionSelected = { index ->
selectedImageIndex = index
},
initialSelectedOption = initialSelectedOption
)
Spacer(modifier = modifier.padding(bottom = 24.dp))
RoundButton(
style = TerningTheme.typography.button0,
paddingVertical = 19.dp,
cornerRadius = 10.dp,
text = R.string.sign_up_dialog_start,
onButtonClick = {
scope.launch { sheetState.hide() }
.invokeOnCompletion {
if (!sheetState.isVisible) {
onSaveClick(selectedImageIndex)
onSaveClick(index)
}
}
},
modifier = modifier.padding(horizontal = 24.dp)
initialSelectedOption = initialSelectedOption
)
Spacer(modifier = modifier.padding(bottom = 15.dp))
Spacer(modifier = modifier.padding(bottom = 26.dp))
}
},
onDismissRequest = { onDismiss() },
Expand All @@ -99,15 +85,15 @@ fun SignUpBottomSheet(
/**
* 6๊ฐœ์˜ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€ ์ค‘, ํ•˜๋‚˜์˜ ์ด๋ฏธ์ง€๋งŒ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” ๋ผ๋””์˜ค ๋ฒ„ํŠผ์ž…๋‹ˆ๋‹ค.
*
* @param modifier ๋ผ๋””์˜ค ๋ฒ„ํŠผ์— ์ ์šฉํ•  Modifier์ž…๋‹ˆ๋‹ค.
* @param onOptionSelected ์„ ํƒ๋œ ์ด๋ฏธ์ง€์˜ ์ธ๋ฑ์Šค ๊ฐ’์„ ๋‚˜ํƒ€๋‚ด๋Š” ์ฝœ๋ฐฑ ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค.
* @param initialSelectedOption ์ดˆ๊ธฐ์— ์„ ํƒ๋œ ์ด๋ฏธ์ง€๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ธ๋ฑ์Šค ๊ฐ’์ž…๋‹ˆ๋‹ค.
* @param modifier ๋ผ๋””์˜ค ๋ฒ„ํŠผ์— ์ ์šฉํ•  Modifier์ž…๋‹ˆ๋‹ค.
*/
@Composable
fun RadioButtonGroup(
modifier: Modifier = Modifier,
onOptionSelected: (Int) -> Unit,
initialSelectedOption: Int
initialSelectedOption: Int,
modifier: Modifier = Modifier,
) {
val options = listOf(
R.drawable.ic_terning_profile_00,
Expand All @@ -122,35 +108,36 @@ fun RadioButtonGroup(

LazyVerticalGrid(
columns = GridCells.Fixed(3),
verticalArrangement = Arrangement.spacedBy(20.dp),
horizontalArrangement = Arrangement.spacedBy(24.dp),
modifier = modifier
.padding(horizontal = 42.dp)
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(20.dp),
modifier = modifier.padding(horizontal = 34.dp)
) {
itemsIndexed(options) { index, option ->
val imageModifier = if (selectedOption == options[index]) {
modifier
Modifier
.border(
color = TerningMain,
width = 2.dp,
shape = CircleShape
)
.aspectRatio(1f)
} else {
modifier
Modifier.aspectRatio(1f)
}

Image(
painter = painterResource(
id = option
),
contentDescription = stringResource(id = R.string.sign_up_bottom_sheet_description),
contentDescription = "profile image",
modifier = imageModifier
.aspectRatio(1f)
.noRippleClickable {
onOptionSelected(index)
selectedOption = option
}
.clip(shape = CircleShape)
.size(76.dp)
.aspectRatio(1f)
)
}
}
Expand Down
Loading

0 comments on commit 52e6c48

Please sign in to comment.