|
@@ -93,66 +93,76 @@ const ButtonPage = () => {
|
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
|
|
return <PageContainer
|
|
return <PageContainer
|
|
|
- isScrollable={false}
|
|
|
|
|
isWorkWithHeaderSpace={false}
|
|
isWorkWithHeaderSpace={false}
|
|
|
|
|
+ isScrollable={false}
|
|
|
style={[
|
|
style={[
|
|
|
stylesheet.container
|
|
stylesheet.container
|
|
|
]}
|
|
]}
|
|
|
>
|
|
>
|
|
|
- <ScrollView
|
|
|
|
|
- style={{ width: "100%", flex: 1 }}
|
|
|
|
|
- contentContainerStyle={{ alignItems: "center", paddingBottom: 50 }}
|
|
|
|
|
- showsVerticalScrollIndicator={false}
|
|
|
|
|
|
|
+ <View
|
|
|
|
|
+ style={[
|
|
|
|
|
+ stylesheet.contentContainer
|
|
|
|
|
+ ]}
|
|
|
>
|
|
>
|
|
|
<View
|
|
<View
|
|
|
- style={[
|
|
|
|
|
- stylesheet.contentContainer
|
|
|
|
|
- ]}
|
|
|
|
|
|
|
+ style={{
|
|
|
|
|
+ borderColor: colors.content.border.subtle,
|
|
|
|
|
+ marginBottom: spaces.spacingMd,
|
|
|
|
|
+ borderRadius: radiuses.form,
|
|
|
|
|
+ borderWidth: borders.line,
|
|
|
|
|
+ padding: spaces.spacingMd,
|
|
|
|
|
+ justifyContent: "center",
|
|
|
|
|
+ alignItems: "center",
|
|
|
|
|
+ minHeight: 120
|
|
|
|
|
+ }}
|
|
|
>
|
|
>
|
|
|
- <View
|
|
|
|
|
|
|
+ <Button
|
|
|
|
|
+ spreadBehaviour={BUTTON_SPREAD_BEHAVIOURS[spreadIndex]}
|
|
|
|
|
+ variant={BUTTON_VARIANTS[variantIndex]}
|
|
|
|
|
+ title={title || "Example Button"}
|
|
|
|
|
+ isCustomPadding={isCustomPadding}
|
|
|
|
|
+ type={BUTTON_TYPES[typeIndex]}
|
|
|
|
|
+ size={BUTTON_SIZES[sizeIndex]}
|
|
|
|
|
+ iconDirection={iconDirection}
|
|
|
|
|
+ isDisabled={isDisabled}
|
|
|
|
|
+ isLoading={isLoading}
|
|
|
|
|
+ icon={showIcon ? ({
|
|
|
|
|
+ color,
|
|
|
|
|
+ size
|
|
|
|
|
+ }) => <HomeIcon
|
|
|
|
|
+ color={colors.content.icon[color]}
|
|
|
|
|
+ size={size}
|
|
|
|
|
+ /> : undefined}
|
|
|
style={{
|
|
style={{
|
|
|
- borderColor: colors.content.border.subtle,
|
|
|
|
|
- marginBottom: spaces.spacingMd,
|
|
|
|
|
- borderRadius: radiuses.form,
|
|
|
|
|
- borderWidth: borders.line,
|
|
|
|
|
- padding: spaces.spacingMd,
|
|
|
|
|
- minHeight: 120,
|
|
|
|
|
- alignItems: "center",
|
|
|
|
|
- justifyContent: "center"
|
|
|
|
|
|
|
+ marginBottom: spaces.spacingLg
|
|
|
}}
|
|
}}
|
|
|
- >
|
|
|
|
|
- <Button
|
|
|
|
|
- title={title || "Example Button"}
|
|
|
|
|
- spreadBehaviour={BUTTON_SPREAD_BEHAVIOURS[spreadIndex]}
|
|
|
|
|
- type={BUTTON_TYPES[typeIndex]}
|
|
|
|
|
- variant={BUTTON_VARIANTS[variantIndex]}
|
|
|
|
|
- size={BUTTON_SIZES[sizeIndex]}
|
|
|
|
|
- isLoading={isLoading}
|
|
|
|
|
- isDisabled={isDisabled}
|
|
|
|
|
- isCustomPadding={isCustomPadding}
|
|
|
|
|
- iconDirection={iconDirection}
|
|
|
|
|
- icon={showIcon ? ({ color, size }) => <HomeIcon color={color as string} size={size} /> : undefined}
|
|
|
|
|
- style={{
|
|
|
|
|
- marginBottom: spaces.spacingLg
|
|
|
|
|
- }}
|
|
|
|
|
- onPress={() => {
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
- </View>
|
|
|
|
|
- <TextInput
|
|
|
|
|
- value={title}
|
|
|
|
|
- onChangeText={setTitle}
|
|
|
|
|
- placeholder="Enter text"
|
|
|
|
|
- title="Button Title"
|
|
|
|
|
- style={{
|
|
|
|
|
- marginBottom: spaces.spacingMd
|
|
|
|
|
|
|
+ onPress={() => {
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <TextInput
|
|
|
|
|
+ spreadBehaviour="stretch"
|
|
|
|
|
+ placeholder="Enter text"
|
|
|
|
|
+ onChangeText={setTitle}
|
|
|
|
|
+ title="Button Title"
|
|
|
|
|
+ value={title}
|
|
|
|
|
+ style={{
|
|
|
|
|
+ marginBottom: spaces.spacingMd
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ <View
|
|
|
|
|
+ style={{
|
|
|
|
|
+ gap: spaces.spacingMd,
|
|
|
|
|
+ flexDirection: "row",
|
|
|
|
|
+ flexWrap: "wrap",
|
|
|
|
|
+ width: "100%"
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
<Button
|
|
<Button
|
|
|
title={`Change Type: ${BUTTON_TYPES[typeIndex]}`}
|
|
title={`Change Type: ${BUTTON_TYPES[typeIndex]}`}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
variant="outline"
|
|
variant="outline"
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setTypeIndex((typeIndex + 1) % BUTTON_TYPES.length);
|
|
setTypeIndex((typeIndex + 1) % BUTTON_TYPES.length);
|
|
|
}}
|
|
}}
|
|
@@ -161,7 +171,7 @@ const ButtonPage = () => {
|
|
|
title={`Change Variant: ${BUTTON_VARIANTS[variantIndex]}`}
|
|
title={`Change Variant: ${BUTTON_VARIANTS[variantIndex]}`}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
variant="outline"
|
|
variant="outline"
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setVariantIndex((variantIndex + 1) % BUTTON_VARIANTS.length);
|
|
setVariantIndex((variantIndex + 1) % BUTTON_VARIANTS.length);
|
|
|
}}
|
|
}}
|
|
@@ -170,7 +180,7 @@ const ButtonPage = () => {
|
|
|
title={`Change Spread: ${BUTTON_SPREAD_BEHAVIOURS[spreadIndex]}`}
|
|
title={`Change Spread: ${BUTTON_SPREAD_BEHAVIOURS[spreadIndex]}`}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
variant="outline"
|
|
variant="outline"
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setSpreadIndex((spreadIndex + 1) % BUTTON_SPREAD_BEHAVIOURS.length);
|
|
setSpreadIndex((spreadIndex + 1) % BUTTON_SPREAD_BEHAVIOURS.length);
|
|
|
}}
|
|
}}
|
|
@@ -179,22 +189,16 @@ const ButtonPage = () => {
|
|
|
title={`Change Size: ${BUTTON_SIZES[sizeIndex]}`}
|
|
title={`Change Size: ${BUTTON_SIZES[sizeIndex]}`}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
variant="outline"
|
|
variant="outline"
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setSizeIndex((sizeIndex + 1) % BUTTON_SIZES.length);
|
|
setSizeIndex((sizeIndex + 1) % BUTTON_SIZES.length);
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
<Button
|
|
<Button
|
|
|
title={`Toggle Icon: ${showIcon ? "ON" : "OFF"}`}
|
|
title={`Toggle Icon: ${showIcon ? "ON" : "OFF"}`}
|
|
|
|
|
+ variant={showIcon ? "filled" : "outline"}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
- variant="outline"
|
|
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
- icon={showIcon ? ({
|
|
|
|
|
- size
|
|
|
|
|
- }) => <HomeIcon
|
|
|
|
|
- color={"white"}
|
|
|
|
|
- size={size}
|
|
|
|
|
- /> : undefined}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setShowIcon(!showIcon);
|
|
setShowIcon(!showIcon);
|
|
|
}}
|
|
}}
|
|
@@ -203,40 +207,40 @@ const ButtonPage = () => {
|
|
|
title={`Toggle Icon Direction: ${iconDirection}`}
|
|
title={`Toggle Icon Direction: ${iconDirection}`}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
variant="outline"
|
|
variant="outline"
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setIconDirection(iconDirection === "left" ? "right" : "left");
|
|
setIconDirection(iconDirection === "left" ? "right" : "left");
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
<Button
|
|
<Button
|
|
|
title={`Toggle Loading: ${isLoading ? "ON" : "OFF"}`}
|
|
title={`Toggle Loading: ${isLoading ? "ON" : "OFF"}`}
|
|
|
|
|
+ variant={isLoading ? "filled" : "outline"}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
- variant="outline"
|
|
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setIsLoading(!isLoading);
|
|
setIsLoading(!isLoading);
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
<Button
|
|
<Button
|
|
|
title={`Toggle Disabled: ${isDisabled ? "ON" : "OFF"}`}
|
|
title={`Toggle Disabled: ${isDisabled ? "ON" : "OFF"}`}
|
|
|
|
|
+ variant={isDisabled ? "filled" : "outline"}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
- variant="outline"
|
|
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setIsDisabled(!isDisabled);
|
|
setIsDisabled(!isDisabled);
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
<Button
|
|
<Button
|
|
|
title={`Toggle Custom Padding: ${isCustomPadding ? "ON" : "OFF"}`}
|
|
title={`Toggle Custom Padding: ${isCustomPadding ? "ON" : "OFF"}`}
|
|
|
|
|
+ variant={isCustomPadding ? "filled" : "outline"}
|
|
|
spreadBehaviour="free"
|
|
spreadBehaviour="free"
|
|
|
- variant="outline"
|
|
|
|
|
- style={{ marginBottom: spaces.spacingMd }}
|
|
|
|
|
|
|
+ size="small"
|
|
|
onPress={() => {
|
|
onPress={() => {
|
|
|
setIsCustomPadding(!isCustomPadding);
|
|
setIsCustomPadding(!isCustomPadding);
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
</View>
|
|
</View>
|
|
|
- </ScrollView>
|
|
|
|
|
|
|
+ </View>
|
|
|
</PageContainer>;
|
|
</PageContainer>;
|
|
|
};
|
|
};
|
|
|
export default ButtonPage;
|
|
export default ButtonPage;
|