Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] 컴포넌트 수정된 사항(button) #29

Merged
merged 4 commits into from
Jan 31, 2024
Merged

[UI] 컴포넌트 수정된 사항(button) #29

merged 4 commits into from
Jan 31, 2024

Conversation

Ko-Eunseo
Copy link
Collaborator

@Ko-Eunseo Ko-Eunseo commented Jan 31, 2024

chips로 되어있던 버튼들 디자인시스템이 수정되면서 buttons 폴더에 파일 이동 및 리팩토링 진행했습니다.

IconButton

SLRectIconButton(
      icon: 'assets/icons/log.svg',
      label: 'log',
      isActive: true,
    );

svg로 되어있는 아이콘과 label을 같이 보내야 합니다.
isActive, onTap 속성을 추가로 받습니다.
Active상태 여부를 isActive 속성에 전달하면 상태에 따라 primary - neutral 컬러가 됩니다.

TabButton

위의 버튼을 활용한 탭버튼입니다. Tabbutton type에 따라 컨텐츠 내용이 바뀝니다.
isActive, onTap 속성을 추가로 받습니다.

SLMainTabButton(
          type: TabButtonType.log,
          isActive: _activeButton == TabButtonType.log,
          onTap: () {
            setState(() {
              _activeButton = TabButtonType.log;
            });
          },
        ),

ButtonSm

원리는 위 버튼들과 같습니다.

class _ButtonSmExampleState extends State<ButtonSmExample> {
  bool isFollow = false;

  void toggleFollow() {
    isFollow = !isFollow;
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: ButtonSm(
        text: isFollow ? '팔로잉' : '팔로우',
        isActive: isFollow,
        onTap: toggleFollow,
      ),
    );
  }
}

@Ko-Eunseo Ko-Eunseo self-assigned this Jan 31, 2024
@Ko-Eunseo Ko-Eunseo merged commit 3cca88e into develop Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant