Login and Home
This commit is contained in:
44
pedi-foods/Sources/PediFoods/Components/Buttons.swift
Normal file
44
pedi-foods/Sources/PediFoods/Components/Buttons.swift
Normal file
@@ -0,0 +1,44 @@
|
||||
import SwiftUI
|
||||
|
||||
struct PrimaryButton: View {
|
||||
let title: String
|
||||
var fullWidth: Bool = true
|
||||
let action: @MainActor @Sendable () -> Void
|
||||
|
||||
var body: some View {
|
||||
Button(action: { action() }) {
|
||||
Text(title)
|
||||
.font(AppTypography.button)
|
||||
.tracking(AppTypography.buttonLetterSpacing)
|
||||
.foregroundStyle(AppColors.textInverse)
|
||||
.frame(maxWidth: fullWidth ? .infinity : nil)
|
||||
.frame(height: 56)
|
||||
.background(AppColors.primary)
|
||||
.clipShape(RoundedRectangle(cornerRadius: AppLayout.radiusLG, style: .continuous))
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
|
||||
struct SecondaryButton: View {
|
||||
let title: String
|
||||
var fullWidth: Bool = true
|
||||
let action: @MainActor @Sendable () -> Void
|
||||
|
||||
var body: some View {
|
||||
Button(action: { action() }) {
|
||||
Text(title)
|
||||
.font(AppTypography.button)
|
||||
.tracking(AppTypography.buttonLetterSpacing)
|
||||
.foregroundStyle(AppColors.primary)
|
||||
.frame(maxWidth: fullWidth ? .infinity : nil)
|
||||
.frame(height: 56)
|
||||
.background(AppColors.backgroundLight)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: AppLayout.radiusLG, style: .continuous)
|
||||
.stroke(AppColors.primary.opacity(0.3), lineWidth: 1)
|
||||
)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user