You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.3 KiB

5 months ago
  1. import React from 'react';
  2. import {Pressable, StyleProp, ViewStyle} from 'react-native';
  3. import {ColorScheme} from './Design';
  4. import {Text} from 'react-native';
  5. export default function EFullButton(props: {
  6. text: string;
  7. active?: boolean;
  8. onPress?: () => void;
  9. style?: StyleProp<ViewStyle>;
  10. }) {
  11. return (
  12. <Pressable
  13. style={[
  14. {
  15. width: '100%',
  16. borderRadius: 4,
  17. backgroundColor: ColorScheme.frostedfill.black[10],
  18. paddingHorizontal: 16,
  19. paddingVertical: 12,
  20. },
  21. props.style,
  22. ]}
  23. onPress={() => props.active && props.onPress && props.onPress()}>
  24. <Text
  25. style={{
  26. color: props.active ? ColorScheme.fill[10] : ColorScheme.fill[40],
  27. textAlign: 'center',
  28. textAlignVertical: 'center',
  29. fontSize: 17,
  30. fontWeight: '600',
  31. }}>
  32. {props.text}
  33. </Text>
  34. </Pressable>
  35. );
  36. }
  37. export function ESmallButton(props: {
  38. text: string;
  39. active?: boolean;
  40. onPress?: () => void;
  41. style?: StyleProp<ViewStyle>;
  42. }) {
  43. return (
  44. <Pressable
  45. style={[{
  46. borderRadius: 4,
  47. backgroundColor: ColorScheme.frostedfill.white[10],
  48. paddingHorizontal: 16,
  49. paddingTop: 12,
  50. paddingBottom: 13,
  51. alignSelf: 'flex-start',
  52. flex: 1,
  53. },props.style]}
  54. onPress={() => props.active && props.onPress && props.onPress()}>
  55. <Text
  56. style={{
  57. color: props.active ? ColorScheme.fill[10] : ColorScheme.fill[40],
  58. fontFamily: 'Pretendard-SemiBold',
  59. textAlign: 'center',
  60. textAlignVertical: 'center',
  61. fontSize: 15,
  62. flex: 1,
  63. }}>
  64. {props.text}
  65. </Text>
  66. </Pressable>
  67. );
  68. }
  69. export function EIconButton(props: {
  70. children: React.ReactNode,
  71. active?: boolean;
  72. onPress?: () => void;
  73. style?: StyleProp<ViewStyle>;
  74. }) {
  75. return (
  76. <Pressable
  77. style={[{
  78. borderRadius: 4,
  79. backgroundColor: ColorScheme.frostedfill.white[10],
  80. paddingHorizontal: 8,
  81. paddingVertical: 8,
  82. justifyContent: 'center',
  83. alignContent: 'center',
  84. height: 40,
  85. },props.style]}
  86. onPress={() => props.active && props.onPress && props.onPress()}>
  87. {props.children}
  88. </Pressable>
  89. );
  90. }