πŸ‘‰λͺ¨λ‹¬μ€ ν™”λ©΄ μœ„μ— μ˜€λ²„λ ˆμ΄λ˜μ–΄ μ‚¬μš©μž μƒν˜Έμž‘μš©μ„ μ°¨λ‹¨ν•˜κ³ , ν•˜λ‚˜μ˜ μž‘μ—… λ˜λŠ” 정보에 μ§‘μ€‘ν•˜λ„λ‘ λ§Œλ“œλŠ” UIμ»¨ν…Œμ΄λ„ˆλ‘œμ„œ μ‚¬μš©μžλ‘œκ·ΈμΈ,λΉ„λ°€λ²ˆν˜Έμž…λ ₯,μ΄λ―Έμ§€ν™•λŒ€λ³΄κΈ°λ“±μ— 많이 μ‚¬μš©λ©λ‹ˆλ‹€.

1.react-native-freelifemakers-ui NPM λͺ¨λ“ˆ μ„€μΉ˜ν•˜κΈ°

npm install react-native-freelifemakers-ui

2.μ‚¬μš©λ²•

βœ”οΈλ²„νŠΌ ν΄λ¦­μ‹œ λͺ¨λ‹¬μ„ μ˜€ν”ˆν•©λ‹ˆλ‹€.

import {FlmModal, FlmButton, FlmText} from 'react-native-freelifemakers-ui';

          <FlmButton
            title="κΈ°λ³Έ λͺ¨λ‹¬ μ—΄κΈ°/Open Default Modal"
            onPress={() => setModal1Visible(true)}
          />
          <FlmModal
            isVisible={isModal1Visible}
            onClose={() => setModal1Visible(false)}
            title="κΈ°λ³Έ λͺ¨λ‹¬/Default Modal"
            message="μ•„λ¬΄λŸ° μ»€μŠ€ν…€ μŠ€νƒ€μΌμ΄ μ μš©λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.
				            /No custom styles were applied."
            animationDirection="slideUp"
          />

3.μ „μ²΄μ½”λ“œ

import React, { useState } from "react";
import { View, StyleSheet, SafeAreaView, ScrollView } from "react-native";
import { FlmModal, FlmButton, FlmText } from "react-native-freelifemakers-ui";

export default function FlmModalApp() {
  const [isModal1Visible, setModal1Visible] = useState(false);
  const [isModal2Visible, setModal2Visible] = useState(false);
  // μ»€μŠ€ν…€ μŠ€νƒ€μΌ 적용 / Apply custom style
  const [isModal3Visible, setModal3Visible] = useState(false); 
  // λ‹€λ₯Έ μ»€μŠ€ν…€ μŠ€νƒ€μΌ / Apply another custom style
  const [isModal4Visible, setModal4Visible] = useState(false); 

  return (
    <SafeAreaView style={appStyles.safeArea}>
      <ScrollView style={appStyles.scrollViewContent}>
        <View style={appStyles.section}>
          <FlmText style={appStyles.header}>FlmModal μ»€μŠ€ν„°λ§ˆμ΄μ§• μ˜ˆμ‹œ</FlmText>

          {/* --- 1. κΈ°λ³Έ μŠ¬λΌμ΄λ“œ λͺ¨λ‹¬ / Default Slide Modal
              -- 'slideUp', 'slideDown', 'slideLeft', 'slideRight', 
              'fade', 'none' --- */}
          <FlmText>
            1. κΈ°λ³Έ μŠ¬λΌμ΄λ“œ λͺ¨λ‹¬ / Default --
            slideUp,slideDown,slideLeft,slideRight, fade, none
          </FlmText>
          <FlmButton
            title="κΈ°λ³Έ λͺ¨λ‹¬ μ—΄κΈ°/Open Default Modal"
            onPress={() => setModal1Visible(true)}
          />
          <FlmModal
            isVisible={isModal1Visible}
            onClose={() => setModal1Visible(false)}
            title="κΈ°λ³Έ λͺ¨λ‹¬/Default Modal"
            message="μ•„λ¬΄λŸ° μ»€μŠ€ν…€ μŠ€νƒ€μΌμ΄ μ μš©λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.
				            /No custom styles were applied."
            animationDirection="slideUp"
          />
          <FlmText>2. μ»€μŠ€ν…€ λͺ¨λ‹¬/Custom Modal</FlmText>
          {/* --- 2. 배경색, 투λͺ…도 λ³€κ²½ λͺ¨λ‹¬ /
            Modal to change background color and transparency --- */}
          <View style={{ marginTop: 20 }}>
            <FlmButton
              title="λ°°κ²½ μ»€μŠ€ν…€ λͺ¨λ‹¬ μ—΄κΈ°/Background Custom Modal"
              onPress={() => setModal2Visible(true)}
            />
          </View>
          <FlmModal
            isVisible={isModal2Visible}
            onClose={() => setModal2Visible(false)}
            title="λ°°κ²½ μ»€μŠ€ν…€/Background Custom"
            message="배경이 νŒŒλž€μƒ‰ 반투λͺ…μœΌλ‘œ λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
				    /The background has been changed to a blue, translucent color."
            animationDirection="fade"
            
            // νŒŒλž€μƒ‰ 반투λͺ… λ°°κ²½ / Blue translucent background
            backdropColor="rgba(0,0,255,0.3)" 
          />

          {/* --- 3. λͺ¨λ‹¬ 컨텐츠 μŠ€νƒ€μΌ λ³€κ²½ λͺ¨λ‹¬ /
            Modal content style change modal --- */}
          <View style={{ marginTop: 20 }}>
            <FlmButton
              title="컨텐츠 μŠ€νƒ€μΌ μ»€μŠ€ν…€ λͺ¨λ‹¬ μ—΄κΈ°
              /Open custom modal with content style"
              onPress={() => setModal3Visible(true)}
            />
          </View>
          <FlmModal
            isVisible={isModal3Visible}
            onClose={() => setModal3Visible(false)}
            title="컨텐츠 μ»€μŠ€ν…€/Content customization"
            message="λͺ¨λ‹¬ 컨텐츠 λ°•μŠ€μ˜ λͺ¨μ–‘이 λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
            /The appearance of the modal content box has changed."
            animationDirection="slideRight"
            modalContentStyle={{
              backgroundColor: "#FFF0F5", // μ—°ν•œ 뢄홍색 / Light pink
              borderRadius: 5, // 덜 λ‘₯κ·Ό λͺ¨μ„œλ¦¬ / Less rounded corners
              borderWidth: 2, // ν…Œλ‘λ¦¬ μΆ”κ°€ / Add border
              borderColor: "#FF69B4", // 핑크색 ν…Œλ‘λ¦¬ / Pink border
              padding: 10, // νŒ¨λ”© 쑰절 / padding adjustment
            }}
            titleStyle={{
              color: "#FF69B4", // 핑크색 제λͺ© / Pink Color Title
              fontSize: 25,
              fontWeight: "normal",
            }}
            messageStyle={{
              color: "#8B008B", // 보라색 λ©”μ‹œμ§€ / Pupple Color Message
              fontStyle: "italic",
            }}
          >
            <FlmText>
              여기에 좔가적인 μ»€μŠ€ν…€ λ‚΄μš©μ΄ λ“€μ–΄κ°ˆ 수 μžˆμŠ΅λ‹ˆλ‹€!/Additional
              custom content can be added here!
            </FlmText>
          </FlmModal>

          {/* --- 4. λ‹€μ–‘ν•œ μŠ€νƒ€μΌ μ„žκΈ° / Mix different styles --- */}
          <View style={{ marginTop: 20 }}>
            <FlmButton
              title="λ‹€μ–‘ν•œ μŠ€νƒ€μΌ μ„žκΈ°/Mix different styles"
              onPress={() => setModal4Visible(true)}
            />
          </View>
          <FlmModal
            isVisible={isModal4Visible}
            onClose={() => setModal4Visible(false)}
            title="MIXED STYLE!"
            message="λ°°κ²½, 컨텐츠, ν…μŠ€νŠΈ μŠ€νƒ€μΌμ΄ λͺ¨λ‘ μ»€μŠ€ν…€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
            /Background, content, and text styles are all customized."
            animationDirection="slideDown"
            animationDuration={500} // μ• λ‹ˆλ©”μ΄μ…˜ μ‹œκ°„λ„ 쑰절 / Adjust animation time
            // 주황색 반투λͺ… λ°°κ²½ / Orange translucent background
            backdropColor="rgba(255,165,0,0.4)" 
            modalContentStyle={{
              backgroundColor: "#E0FFFF", // μ—°ν•œ ν•˜λŠ˜μƒ‰ / light sky blue
              borderRadius: 30, // 더 λ‘₯κ·Ό λͺ¨μ„œλ¦¬ / more rounded corners
              shadowColor: "#000",
              shadowOffset: { width: 0, height: 4 },
              shadowOpacity: 0.3,
              shadowRadius: 5,
              elevation: 8,
            }}
            titleStyle={{
              color: "#4682B4", // μŠ€ν‹ΈλΈ”λ£¨ 제λͺ© / steel blue title
              textDecorationLine: "underline",
            }}
            messageStyle={{
            // μ–΄λ‘μš΄ 슬레이트 그레이 λ©”μ‹œμ§€ / Dark slate grey message
              color: "#2F4F4F", 
              lineHeight: 24,
            }}
          />
        </View>
      </ScrollView>
    </SafeAreaView>
  );
}

const appStyles = StyleSheet.create({
  safeArea: {
    flex: 1,
    backgroundColor: "#f0f2f5",
  },
  scrollViewContent: {
    padding: 20,
  },
  header: {
    // μ‚­μ œμ˜ˆμ •
    fontSize: 24,
    fontWeight: "bold",
    marginBottom: 30,
    color: "#333",
    textAlign: "center",
  },
  section: {
    marginBottom: 30,
    padding: 15,
    backgroundColor: "#fff",
    borderRadius: 10,
    shadowColor: "#000",
    shadowOffset: { width: 0, height: 2 },
    shadowOpacity: 0.1,
    shadowRadius: 3,
    elevation: 5,
  },
  customChildrenText: {
    //μ‚­μ œμ˜ˆμ •
    fontSize: 14,
    color: "#333",
    marginTop: 10,
    marginBottom: 15,
    textAlign: "center",
    fontStyle: "italic",
  },
});

3.μŠ€ν¬λ¦°μƒ·

https://youtube.com/shorts/ycFyJC9O68U?feature=share