-
Notifications
You must be signed in to change notification settings - Fork 33
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
IOS-8083 Make ai token view token description error #4003
Open
skibinalexander
wants to merge
15
commits into
develop
Choose a base branch
from
feature/IOS-8083_make_ai_token_view
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+134
−24
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b764d99
IOS-8083 Separated token markets details sheet info
skibinalexander 39d8abd
IOS-8083 Make correct flow send email
skibinalexander 2044886
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander cb267d6
IOS-8083 Add middle stage for task
skibinalexander 4f95188
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander 8a5371e
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander 233ba1a
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander 18244b4
IOS-8083 Fix changes
skibinalexander 6cccfc3
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander eb637bb
IOS-8083 Make finalize changes for task
skibinalexander 012d854
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander 1d70190
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander ced79bd
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander cc277a3
IOS-8083 Make eng text
skibinalexander 0787837
Merge branch 'develop' into feature/IOS-8083_make_ai_token_view
skibinalexander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
55 changes: 55 additions & 0 deletions
55
Tangem/UIComponents/DescriptionBottomSheet/TokenDescriptionBottomSheetView.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,55 @@ | ||
// | ||
// TokenDescriptionBottomSheetView.swift | ||
// Tangem | ||
// | ||
// Created by Alexander Skibin on 01.10.2024. | ||
// Copyright © 2024 Tangem AG. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import MarkdownUI | ||
|
||
struct TokenDescriptionBottomSheetView: View { | ||
let info: DescriptionBottomSheetInfo | ||
var generatedWithAIAction: (() -> Void)? = nil | ||
|
||
@Environment(\.dismiss) private var dismissSheetAction | ||
@State private var containerHeight: CGFloat = 0 | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 10) { | ||
DescriptionBottomSheetView(info: info) | ||
|
||
Button { | ||
generatedWithAIAction?() | ||
} label: { | ||
generatedWithAILabel | ||
} | ||
.padding(.horizontal, 16) | ||
.disabled(generatedWithAIAction == nil) | ||
} | ||
} | ||
} | ||
|
||
// View components | ||
private extension TokenDescriptionBottomSheetView { | ||
var generatedWithAILabel: some View { | ||
HStack(spacing: 12) { | ||
Assets.stars.image | ||
.foregroundStyle(Colors.Icon.accent) | ||
|
||
Text(Localization.informationGeneratedWithAi) | ||
.multilineTextAlignment(.leading) | ||
.style(Fonts.Regular.footnote, color: Colors.Text.primary1) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
} | ||
.defaultRoundedBackground(with: Colors.Background.tertiary) | ||
} | ||
} | ||
|
||
#Preview { | ||
TokenDescriptionBottomSheetView(info: .init( | ||
title: "About Ethereum", | ||
description: "Ethereum network is a blockchain network.\n- Ethereum is an open-source platform for decentralized applications.\n- It aims to create a world computer for building applications in a decentralized manner.\n- Supports smart contracts allowing developers to program digital value.\n- Examples of dapps include tokens, NFTs, DeFi apps, lending protocols, and decentralized exchanges.\n- Transactions and smart contract executions require Gas fees, paid in Ether (ETH).\n- Gas measures the computational effort needed for operations, with fees fluctuating based on network demand.\n\n• Tether (USDT) is a stablecoin pegged to the U.S. dollar. \n • It offers stability in the volatile crypto market. \n• Issued by Tether Limited, governed by British Virgin Islands laws.\n• Used on exchanges like Bitfinex for trading cryptocurrencies.\n• Facilitates quick and cheap fiat movement in exchanges.\n• No transaction fees, but conversion fees apply on Tether.to.\n• Supports Ethereum network; ending support on EOS, Algorand, and others." | ||
)) | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а его точно надо скрывать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так точно, добавлю коммент, иначе не открывается поверх Боттом шит емейла
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну и в целом это нормальное поведение чтобы не городить матрешек по шторкам