-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce6d47a
commit d26b02c
Showing
92 changed files
with
3,302 additions
and
608 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
BaseStyle/BaseStyle/CustomUI/Buttons/PrimaryFloatingButton.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// PrimaryFloatingButton.swift | ||
// BaseStyle | ||
// | ||
// Created by Amisha Italiya on 11/03/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct PrimaryFloatingButton: View { | ||
|
||
private let text: String | ||
private let bottomPadding: CGFloat | ||
private let isEnabled: Bool | ||
private let showLoader: Bool | ||
private let onClick: (() -> Void)? | ||
|
||
public init(text: String, bottomPadding: CGFloat = 24, isEnabled: Bool = true, showLoader: Bool = false, onClick: (() -> Void)? = nil) { | ||
self.text = text | ||
self.bottomPadding = bottomPadding | ||
self.isEnabled = isEnabled | ||
self.showLoader = showLoader | ||
self.onClick = onClick | ||
} | ||
|
||
public var body: some View { | ||
VStack(alignment: .center, spacing: 0) { | ||
VSpacer(10) | ||
|
||
PrimaryButton(text: text, isEnabled: !showLoader && isEnabled, showLoader: showLoader, onClick: onClick) | ||
} | ||
.padding(.horizontal, 16) | ||
.padding(.bottom, bottomPadding) | ||
.background(FloatingButtonGradientBackground()) | ||
} | ||
} | ||
|
||
public struct FloatingButtonGradientBackground: View { | ||
public init() {} | ||
|
||
public var body: some View { | ||
LinearGradient(colors: [surfaceColor, surfaceColor, surfaceColor, surfaceColor, surfaceColor, surfaceColor.opacity(1), surfaceColor.opacity(0)], startPoint: .bottom, endPoint: .top) | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.