Skip to content

Commit

Permalink
feat: add ui for create wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
lednhatkhanh committed Nov 22, 2024
1 parent 28c46f7 commit b4e4a3b
Show file tree
Hide file tree
Showing 21 changed files with 521 additions and 10 deletions.
46 changes: 41 additions & 5 deletions MinWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@
575157E72CEB4526004CD647 /* Inter-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 575157AF2CEB4526004CD647 /* Inter-Regular.ttf */; };
575157E82CEB4526004CD647 /* Inter-LightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 575157AC2CEB4526004CD647 /* Inter-LightItalic.ttf */; };
575157E92CEB4526004CD647 /* Inter-ExtraBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 575157A72CEB4526004CD647 /* Inter-ExtraBoldItalic.ttf */; };
575196FD2CF024A900713506 /* AppCheckbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575196FC2CF024A500713506 /* AppCheckbox.swift */; };
5774769B2CED9A280066CFB6 /* Carousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5774769A2CED9A220066CFB6 /* Carousel.swift */; };
577550D92CEC442100DD7531 /* AppIconButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577550D82CEC441D00DD7531 /* AppIconButton.swift */; };
578451AB2CF0306600439044 /* ReInputSeedPhrase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 578451AA2CF0306100439044 /* ReInputSeedPhrase.swift */; };
578C60322CEF90A700E93A08 /* CreateWalletScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 578C60312CEF90A300E93A08 /* CreateWalletScreen.swift */; };
578C60362CEF981000E93A08 /* BeforeYouStart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 578C60352CEF980A00E93A08 /* BeforeYouStart.swift */; };
579AFF782CEF9D0A00A9B375 /* RevealSeedPhrase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 579AFF772CEF9D0700A9B375 /* RevealSeedPhrase.swift */; };
579AFF7A2CEFA1F400A9B375 /* AppTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 579AFF792CEFA1F100A9B375 /* AppTextField.swift */; };
57A6D91C2CEC3982009CF6CD /* AppBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A6D91B2CEC3980009CF6CD /* AppBar.swift */; };
57F102962C64CCA0000B3544 /* MinWalletApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57F102952C64CCA0000B3544 /* MinWalletApp.swift */; };
57F102982C64CCA0000B3544 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57F102972C64CCA0000B3544 /* ContentView.swift */; };
Expand Down Expand Up @@ -130,8 +136,14 @@
575157C32CEB4526004CD647 /* InterDisplay-SemiBoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "InterDisplay-SemiBoldItalic.ttf"; sourceTree = "<group>"; };
575157C42CEB4526004CD647 /* InterDisplay-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "InterDisplay-Thin.ttf"; sourceTree = "<group>"; };
575157C52CEB4526004CD647 /* InterDisplay-ThinItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "InterDisplay-ThinItalic.ttf"; sourceTree = "<group>"; };
575196FC2CF024A500713506 /* AppCheckbox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCheckbox.swift; sourceTree = "<group>"; };
5774769A2CED9A220066CFB6 /* Carousel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carousel.swift; sourceTree = "<group>"; };
577550D82CEC441D00DD7531 /* AppIconButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIconButton.swift; sourceTree = "<group>"; };
578451AA2CF0306100439044 /* ReInputSeedPhrase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReInputSeedPhrase.swift; sourceTree = "<group>"; };
578C60312CEF90A300E93A08 /* CreateWalletScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateWalletScreen.swift; sourceTree = "<group>"; };
578C60352CEF980A00E93A08 /* BeforeYouStart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeforeYouStart.swift; sourceTree = "<group>"; };
579AFF772CEF9D0700A9B375 /* RevealSeedPhrase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RevealSeedPhrase.swift; sourceTree = "<group>"; };
579AFF792CEFA1F100A9B375 /* AppTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTextField.swift; sourceTree = "<group>"; };
57A6D9192CEC35BF009CF6CD /* Mobile.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Mobile.xcframework; path = rust/ios/Mobile.xcframework; sourceTree = "<group>"; };
57A6D91A2CEC3604009CF6CD /* mwrust.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = mwrust.swift; path = rust/bindings/mwrust.swift; sourceTree = "<group>"; };
57A6D91B2CEC3980009CF6CD /* AppBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppBar.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -211,6 +223,7 @@
575157902CEB43FF004CD647 /* Features */ = {
isa = PBXGroup;
children = (
578C602F2CEF908800E93A08 /* Create Wallet */,
5751578F2CEB43FF004CD647 /* Home */,
);
path = Features;
Expand All @@ -219,6 +232,8 @@
575157942CEB4407004CD647 /* Components */ = {
isa = PBXGroup;
children = (
575196FC2CF024A500713506 /* AppCheckbox.swift */,
579AFF792CEFA1F100A9B375 /* AppTextField.swift */,
577550D82CEC441D00DD7531 /* AppIconButton.swift */,
57A6D91B2CEC3980009CF6CD /* AppBar.swift */,
575157922CEB4407004CD647 /* AppButton.swift */,
Expand Down Expand Up @@ -310,6 +325,25 @@
path = Components;
sourceTree = "<group>";
};
578C602F2CEF908800E93A08 /* Create Wallet */ = {
isa = PBXGroup;
children = (
578C60332CEF97F300E93A08 /* Components */,
578C60312CEF90A300E93A08 /* CreateWalletScreen.swift */,
);
path = "Create Wallet";
sourceTree = "<group>";
};
578C60332CEF97F300E93A08 /* Components */ = {
isa = PBXGroup;
children = (
578451AA2CF0306100439044 /* ReInputSeedPhrase.swift */,
579AFF772CEF9D0700A9B375 /* RevealSeedPhrase.swift */,
578C60352CEF980A00E93A08 /* BeforeYouStart.swift */,
);
path = Components;
sourceTree = "<group>";
};
57F102892C64CCA0000B3544 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -443,7 +477,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1540;
LastUpgradeCheck = 1540;
LastUpgradeCheck = 1610;
TargetAttributes = {
57F102912C64CCA0000B3544 = {
CreatedOnToolsVersion = 15.4;
Expand Down Expand Up @@ -546,21 +580,27 @@
buildActionMask = 2147483647;
files = (
575157912CEB43FF004CD647 /* HomeScreen.swift in Sources */,
579AFF782CEF9D0A00A9B375 /* RevealSeedPhrase.swift in Sources */,
5718EB1A2CEDE5BA00CDE34D /* DisableBounces.swift in Sources */,
577550D92CEC442100DD7531 /* AppIconButton.swift in Sources */,
57F102982C64CCA0000B3544 /* ContentView.swift in Sources */,
5774769B2CED9A280066CFB6 /* Carousel.swift in Sources */,
5718EB1D2CEDF72000CDE34D /* ShortenAddress.swift in Sources */,
578C60322CEF90A700E93A08 /* CreateWalletScreen.swift in Sources */,
5751579B2CEB4407004CD647 /* AppButton.swift in Sources */,
5751579C2CEB4407004CD647 /* Others.swift in Sources */,
5751579D2CEB4407004CD647 /* AppIcon.swift in Sources */,
57A6D91C2CEC3982009CF6CD /* AppBar.swift in Sources */,
5751579E2CEB4407004CD647 /* Font.swift in Sources */,
578451AB2CF0306600439044 /* ReInputSeedPhrase.swift in Sources */,
57F102962C64CCA0000B3544 /* MinWalletApp.swift in Sources */,
7B0080B69E81CABECF03244F /* TokenLogo.swift in Sources */,
E92422734A5D6B793E704F95 /* TokenListItem.swift in Sources */,
578C60362CEF981000E93A08 /* BeforeYouStart.swift in Sources */,
D2B5710AE714343499F0B704 /* TokenList.swift in Sources */,
2802CFDB8CD6498862AF73F2 /* Token.swift in Sources */,
579AFF7A2CEFA1F400A9B375 /* AppTextField.swift in Sources */,
575196FD2CF024A900713506 /* AppCheckbox.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -777,7 +817,6 @@
57F102BA2C64CCA1000B3544 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand All @@ -796,7 +835,6 @@
57F102BB2C64CCA1000B3544 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
Expand All @@ -815,7 +853,6 @@
57F102BD2C64CCA1000B3544 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -832,7 +869,6 @@
57F102BE2C64CCA1000B3544 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.280",
"green" : "0.100",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.080",
"blue" : "0.280",
"green" : "0.100",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
12 changes: 12 additions & 0 deletions MinWallet/Assets.xcassets/icons/arrow-left.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "arrow-left.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
12 changes: 12 additions & 0 deletions MinWallet/Assets.xcassets/icons/check.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "check.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
12 changes: 12 additions & 0 deletions MinWallet/Assets.xcassets/icons/eye.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "eye.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
51 changes: 51 additions & 0 deletions MinWallet/Features/Create Wallet/Components/BeforeYouStart.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import SwiftUI

struct BeforeYouStart: View {
private let tips = [
"If I lose my seed phrase, my assets will be lost forever.",
"If I share my seed phrase with others, my assets will be stolen.",
"The seed phrase is only stored on my computer, and Minswap has no access to it.",
"If I clear my local storage without backing up the seed phrase, Minswap cannot retrieve it for me.",
]

var onNext: () -> Void

var body: some View {
VStack {
VStack(alignment: .leading, spacing: Spacing.lg) {
Text("Before you start, please read and keep the following security tips in mind.").font(
.paragraphSmall
).foregroundColor(.appTentPrimary).frame(maxWidth: .infinity, alignment: .leading)

ForEach(tips, id: \.self) { tip in
HStack(alignment: .top) {
HStack {
AppIcon(name: .check, size: 20, color: .white)
}.padding(Spacing.xxs).background(.appToneHighlight).cornerRadius(BorderRadius.full)

Text(tip).font(.paragraphSmall).foregroundColor(.appTentPrimarySub)
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(Spacing.xl)
.cornerRadius(BorderRadius._3xl)
.overlay(
RoundedRectangle(cornerRadius: BorderRadius._3xl)
.stroke(
Color.appBorderPrimarySub,
lineWidth: 1)
)
}
}.padding(.horizontal, Spacing.xl).padding(.vertical, Spacing.lg)

Spacer()

Group {
AppButton(title: "Next", variant: .primary, fullWidth: true, size: .lg, action: onNext)
}.padding(.horizontal, Spacing.xl).padding(.top, Spacing._3xl)
}
}
}

#Preview {
BeforeYouStart(onNext: {})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import SwiftUI
import UniformTypeIdentifiers

struct ReInputSeedPhrase: View {
var onBack: () -> Void
var onNext: () -> Void

@State private var text: String = ""

var body: some View {

VStack {
VStack(alignment: .leading, spacing: Spacing.lg) {
Text("Please write down your 24 words seed phrase and store it in a secured place.")
.font(
.paragraphSmall
).foregroundColor(.appTentPrimary).frame(maxWidth: .infinity, alignment: .leading)

LazyVGrid(columns: columns, spacing: Spacing.lg) {
ForEach(0..<24, id: \.self) { index in
AppTextField(
text: .constant(""),
prefix: String(index + 1)
)
}
}
}.padding(.horizontal, Spacing.xl).padding(.vertical, Spacing.lg)

Spacer()

Group {
AppButton(
title: "Next", variant: .primary, fullWidth: true, size: .lg,
action: onNext)
}.padding(.horizontal, Spacing.xl).padding(.top, Spacing._3xl)
}

}
}

private let columns = [
GridItem(.flexible()),
GridItem(.flexible()),
]

#Preview {
ReInputSeedPhrase(onBack: {}, onNext: {})
}
Loading

0 comments on commit b4e4a3b

Please sign in to comment.