-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT]: Implement UI for displaying top ten cryptocurrencies
This commit introduces a new UI component for the CryptoPulse app that displays a list of the top ten cryptocurrencies. Each entry in the list includes the cryptocurrency's name, an image, and the current price, providing users with a quick overview of the market's leading assets. Resolves: #4 [FEAT]: Implement details section UI for cryptocurrency This commit adds a detailed UI section for displaying selected cryptocurrency information within the CryptoPulse app. The details section includes the cryptocurrency's description, a link to its official website, and historical market prices, offering users in-depth information about their chosen crypto asset. Resolves: #5 [FEAT]: Integrate market chart for historical prices (Optional) This commit integrates a simple market chart in the details section of the CryptoPulse app, visually representing the historical prices of the selected cryptocurrency. This feature enhances the user's ability to analyze market trends directly within the app. Resolves: #6
- Loading branch information
Showing
34 changed files
with
2,115 additions
and
70 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
0.application/CryptoPulse/Assets.xcassets/AppIcon.appiconset/Contents.json
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "1024.png", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// ExpandableView.swift | ||
// CryptoView | ||
// | ||
// Created by francesco scalise on 21/03/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ExpandableView: View { | ||
@State private var isExpanded = false | ||
|
||
private let headerText: String | ||
private let bodyText: String | ||
|
||
private let textStyle: Font = .body | ||
private let textColor: Color = .white | ||
|
||
private let previewLimit: Int = 100 | ||
|
||
public init(fullText: String) { | ||
if fullText.count > previewLimit { | ||
let index = fullText.index(fullText.startIndex, offsetBy: previewLimit) | ||
self.headerText = String(fullText[..<index]) + "..." | ||
self.bodyText = String(fullText[index...]) | ||
} else { | ||
self.headerText = fullText | ||
self.bodyText = "" | ||
} | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading) { | ||
if !isExpanded { | ||
Text(headerText) | ||
.font(textStyle) | ||
.foregroundColor(textColor) | ||
.onTapGesture { | ||
withAnimation { | ||
self.isExpanded.toggle() | ||
} | ||
} | ||
} else { | ||
Text(headerText.dropLast(3) + bodyText) | ||
.font(textStyle) | ||
.foregroundColor(textColor) | ||
.onTapGesture { | ||
withAnimation { | ||
self.isExpanded.toggle() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.