Skip to content

Commit

Permalink
feat: display a component if the feedback is not ready for review.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardPaligot committed Jul 15, 2024
1 parent deddcd3 commit f808c27
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 18 deletions.
6 changes: 5 additions & 1 deletion openfeedback-m3/api/openfeedback-m3.api
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ public final class io/openfeedback/m3/ComposableSingletons$VoteItemsPreviewKt {
public final fun getLambda-2$openfeedback_m3_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/openfeedback/m3/FeedbackNotReadyKt {
public static final fun FeedbackNotReady-3IgeMak (Landroidx/compose/ui/Modifier;JLandroidx/compose/foundation/layout/PaddingValues;Landroidx/compose/runtime/Composer;II)V
}

public final class io/openfeedback/m3/LoadingKt {
public static final fun Loading (Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
}

public final class io/openfeedback/m3/OpenFeedbackLayoutKt {
public static final fun OpenFeedbackLayout (Lio/openfeedback/ui/models/UISessionFeedback;Landroidx/compose/ui/Modifier;ILandroidx/compose/foundation/layout/Arrangement$Horizontal;Landroidx/compose/foundation/layout/Arrangement$Vertical;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
public static final fun OpenFeedbackLayout (Lio/openfeedback/ui/models/UISessionFeedback;Landroidx/compose/ui/Modifier;IZLandroidx/compose/foundation/layout/Arrangement$Horizontal;Landroidx/compose/foundation/layout/Arrangement$Vertical;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
}

public final class io/openfeedback/m3/VoteCardKt {
Expand Down
3 changes: 2 additions & 1 deletion openfeedback-m3/api/openfeedback-m3.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Library unique name: <io.openfeedback:openfeedback-m3>
final fun io.openfeedback.m3/Comment(io.openfeedback.ui.models/UIComment, androidx.compose.ui/Modifier?, androidx.compose.ui.graphics/Color, androidx.compose.ui.graphics/Color, androidx.compose.ui.text/TextStyle?, androidx.compose.ui.text/TextStyle?, androidx.compose.ui.graphics/Shape?, kotlin/Function1<io.openfeedback.ui.models/UIComment, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback.m3/Comment|Comment(io.openfeedback.ui.models.UIComment;androidx.compose.ui.Modifier?;androidx.compose.ui.graphics.Color;androidx.compose.ui.graphics.Color;androidx.compose.ui.text.TextStyle?;androidx.compose.ui.text.TextStyle?;androidx.compose.ui.graphics.Shape?;kotlin.Function1<io.openfeedback.ui.models.UIComment,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun io.openfeedback.m3/CommentInput(kotlin/String, kotlin/Function1<kotlin/String, kotlin/Unit>, kotlin/Function0<kotlin/Unit>, androidx.compose.ui/Modifier?, kotlin/Boolean, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback.m3/CommentInput|CommentInput(kotlin.String;kotlin.Function1<kotlin.String,kotlin.Unit>;kotlin.Function0<kotlin.Unit>;androidx.compose.ui.Modifier?;kotlin.Boolean;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun io.openfeedback.m3/FeedbackNotReady(androidx.compose.ui/Modifier?, androidx.compose.ui.graphics/Color, androidx.compose.foundation.layout/PaddingValues?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback.m3/FeedbackNotReady|FeedbackNotReady(androidx.compose.ui.Modifier?;androidx.compose.ui.graphics.Color;androidx.compose.foundation.layout.PaddingValues?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun io.openfeedback.m3/Loading(androidx.compose.ui/Modifier?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback.m3/Loading|Loading(androidx.compose.ui.Modifier?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun io.openfeedback.m3/OpenFeedbackLayout(io.openfeedback.ui.models/UISessionFeedback, androidx.compose.ui/Modifier?, kotlin/Int, androidx.compose.foundation.layout/Arrangement.Horizontal?, androidx.compose.foundation.layout/Arrangement.Vertical?, kotlin/Function4<androidx.compose.foundation.layout/ColumnScope, io.openfeedback.ui.models/UIComment, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, kotlin/Function3<androidx.compose.foundation.layout/ColumnScope, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, kotlin/Function4<androidx.compose.foundation.layout/ColumnScope, io.openfeedback.ui.models/UIVoteItem, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback.m3/OpenFeedbackLayout|OpenFeedbackLayout(io.openfeedback.ui.models.UISessionFeedback;androidx.compose.ui.Modifier?;kotlin.Int;androidx.compose.foundation.layout.Arrangement.Horizontal?;androidx.compose.foundation.layout.Arrangement.Vertical?;kotlin.Function4<androidx.compose.foundation.layout.ColumnScope,io.openfeedback.ui.models.UIComment,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;kotlin.Function3<androidx.compose.foundation.layout.ColumnScope,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;kotlin.Function4<androidx.compose.foundation.layout.ColumnScope,io.openfeedback.ui.models.UIVoteItem,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun io.openfeedback.m3/OpenFeedbackLayout(io.openfeedback.ui.models/UISessionFeedback, androidx.compose.ui/Modifier?, kotlin/Int, kotlin/Boolean, androidx.compose.foundation.layout/Arrangement.Horizontal?, androidx.compose.foundation.layout/Arrangement.Vertical?, kotlin/Function4<androidx.compose.foundation.layout/ColumnScope, io.openfeedback.ui.models/UIComment, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, kotlin/Function3<androidx.compose.foundation.layout/ColumnScope, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, kotlin/Function4<androidx.compose.foundation.layout/ColumnScope, io.openfeedback.ui.models/UIVoteItem, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback.m3/OpenFeedbackLayout|OpenFeedbackLayout(io.openfeedback.ui.models.UISessionFeedback;androidx.compose.ui.Modifier?;kotlin.Int;kotlin.Boolean;androidx.compose.foundation.layout.Arrangement.Horizontal?;androidx.compose.foundation.layout.Arrangement.Vertical?;kotlin.Function4<androidx.compose.foundation.layout.ColumnScope,io.openfeedback.ui.models.UIComment,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;kotlin.Function3<androidx.compose.foundation.layout.ColumnScope,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;kotlin.Function4<androidx.compose.foundation.layout.ColumnScope,io.openfeedback.ui.models.UIVoteItem,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun io.openfeedback.m3/VoteCard(io.openfeedback.ui.models/UIVoteItem, androidx.compose.ui/Modifier?, androidx.compose.ui.text/TextStyle?, androidx.compose.ui.graphics/Color, androidx.compose.ui.graphics/Color, androidx.compose.ui.graphics/Shape?, kotlin/Function1<io.openfeedback.ui.models/UIVoteItem, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.openfeedback.m3/VoteCard|VoteCard(io.openfeedback.ui.models.UIVoteItem;androidx.compose.ui.Modifier?;androidx.compose.ui.text.TextStyle?;androidx.compose.ui.graphics.Color;androidx.compose.ui.graphics.Color;androidx.compose.ui.graphics.Shape?;kotlin.Function1<io.openfeedback.ui.models.UIVoteItem,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
1 change: 1 addition & 0 deletions openfeedback-m3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ library(
api(projects.openfeedbackUiModels)

implementation(kotlinMultiplatformExtension.compose.material3)
implementation(kotlinMultiplatformExtension.compose.materialIconsExtended)
}
}
val androidMain by getting {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package io.openfeedback.m3

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.SentimentDissatisfied
import androidx.compose.material.icons.filled.SentimentNeutral
import androidx.compose.material.icons.filled.SentimentSatisfied
import androidx.compose.material.icons.filled.SentimentVeryDissatisfied
import androidx.compose.material.icons.filled.SentimentVerySatisfied
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import io.openfeedback.resources.LocalStrings

@Composable
fun FeedbackNotReady(
modifier: Modifier = Modifier,
containerColor: Color = MaterialTheme.colorScheme.surfaceContainerHigh,
contentPadding: PaddingValues = PaddingValues(32.dp)
) {
Surface(modifier = modifier, color = containerColor) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(contentPadding),
) {
Box(
modifier = Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center
) {
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Icon(
imageVector = Icons.Default.SentimentVerySatisfied,
contentDescription = null,
modifier = Modifier.size(32.dp)
)
Icon(
imageVector = Icons.Default.SentimentSatisfied,
contentDescription = null,
modifier = Modifier.size(32.dp)
)
Icon(
imageVector = Icons.Default.SentimentNeutral,
contentDescription = null,
modifier = Modifier.size(32.dp)
)
Icon(
imageVector = Icons.Default.SentimentDissatisfied,
contentDescription = null,
modifier = Modifier.size(32.dp)
)
Icon(
imageVector = Icons.Default.SentimentVeryDissatisfied,
contentDescription = null,
modifier = Modifier.size(32.dp)
)
}
}
Spacer(modifier = Modifier.height(16.dp))
Text(
text = LocalStrings.current.strings.notReady.title,
style = MaterialTheme.typography.titleMedium
)
Text(text = LocalStrings.current.strings.notReady.description)
}
}
}
26 changes: 21 additions & 5 deletions openfeedback-resources/api/openfeedback-resources.api
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ public final class io/openfeedback/resources/LocalStringsKt {
public static final fun getLocalStrings ()Landroidx/compose/runtime/ProvidableCompositionLocal;
}

public final class io/openfeedback/resources/NotReadyStrings {
public static final field $stable I
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;Ljava/lang/String;)Lio/openfeedback/resources/NotReadyStrings;
public static synthetic fun copy$default (Lio/openfeedback/resources/NotReadyStrings;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/openfeedback/resources/NotReadyStrings;
public fun equals (Ljava/lang/Object;)Z
public final fun getDescription ()Ljava/lang/String;
public final fun getTitle ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class io/openfeedback/resources/Res {
public static final field $stable I
public static final field INSTANCE Lio/openfeedback/resources/Res;
Expand Down Expand Up @@ -59,15 +73,17 @@ public final class io/openfeedback/resources/Res$string {

public final class io/openfeedback/resources/Strings {
public static final field $stable I
public fun <init> (Lio/openfeedback/resources/CommentStrings;Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Lio/openfeedback/resources/CommentStrings;
public final fun component2 ()Ljava/lang/String;
public fun <init> (Lio/openfeedback/resources/NotReadyStrings;Lio/openfeedback/resources/CommentStrings;Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Lio/openfeedback/resources/NotReadyStrings;
public final fun component2 ()Lio/openfeedback/resources/CommentStrings;
public final fun component3 ()Ljava/lang/String;
public final fun copy (Lio/openfeedback/resources/CommentStrings;Ljava/lang/String;Ljava/lang/String;)Lio/openfeedback/resources/Strings;
public static synthetic fun copy$default (Lio/openfeedback/resources/Strings;Lio/openfeedback/resources/CommentStrings;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/openfeedback/resources/Strings;
public final fun component4 ()Ljava/lang/String;
public final fun copy (Lio/openfeedback/resources/NotReadyStrings;Lio/openfeedback/resources/CommentStrings;Ljava/lang/String;Ljava/lang/String;)Lio/openfeedback/resources/Strings;
public static synthetic fun copy$default (Lio/openfeedback/resources/Strings;Lio/openfeedback/resources/NotReadyStrings;Lio/openfeedback/resources/CommentStrings;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lio/openfeedback/resources/Strings;
public fun equals (Ljava/lang/Object;)Z
public final fun getComments ()Lio/openfeedback/resources/CommentStrings;
public final fun getFromYou ()Ljava/lang/String;
public final fun getNotReady ()Lio/openfeedback/resources/NotReadyStrings;
public final fun getPoweredBy ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
Expand Down
Loading

0 comments on commit f808c27

Please sign in to comment.