Skip to content

Commit bc545da

Browse files
authored
Fix MPT page issuer text overflow (#1277)
## High Level Overview of Change <!-- Please include a summary/list of the changes. If too broad, please consider splitting into multiple PRs. --> ### Context of Change <!-- Please include the context of a change. If a bug fix, when was the bug introduced? What was the behavior? If a new feature, why was this architecture chosen? What were the alternatives? If a refactor, how is this better than the previous implementation? If there is a design document for this feature, please link it here. --> ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (non-breaking change that only restructures code) - [ ] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Translation Updates - [ ] Release ### Codebase Modernization <!-- In an effort to modernize the codebase, you should convert the files that you work with to React Hooks and TypeScript, and update tests to use the React Testing Library instead of Enzyme. If this is not possible (e.g. it's too many changes, touching too many files, etc.) please explain why here. --> - [ ] Updated files to React Hooks - [ ] Updated files to TypeScript - [ ] Updated tests to React Testing Library ## Before / After <!-- If just refactoring / back-end changes, this can be just an in-English description of the change at a technical level. If a UI change, screenshots should be included. --> Before - https://testnet.xrpl.org/mpt/00D3D41E4275D6A8A237BC0AA5268D60986785C36D485705 After - https://testnet.dev.ripplex.io/mpt/00D3D41E4275D6A8A237BC0AA5268D60986785C36D485705 ## Test Plan <!-- Please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce. --> <!-- ## Future Tasks For future tasks related to PR. -->
1 parent 058f219 commit bc545da

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

src/containers/Token/IOU/Header/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ export const Header = ({
158158
<Currency currency={currency} />
159159
{tokenData.issuer_name && (
160160
<div className="token-issuer-wrap">
161-
<span className="paren">(</span>
162-
<div className="issuer-name">
161+
<span className="issuer-name">
162+
(
163163
{tokenData.issuer_name
164164
.trim()
165165
.toUpperCase()
166166
.replace(/\(/g, '')
167167
.replace(/\)/g, '')}
168-
</div>
169-
<span className="paren">)</span>
168+
)
169+
</span>
170170
</div>
171171
)}
172172
</div>

src/containers/Token/IOU/test/Header/Header.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('Header Component', () => {
129129
/>
130130
</TestWrapper>,
131131
)
132-
expect(screen.getByText('TEST ISSUER')).toBeInTheDocument()
132+
expect(screen.getByText('(TEST ISSUER)')).toBeInTheDocument()
133133
})
134134

135135
it('displays issuer domain link when available', () => {
@@ -351,7 +351,7 @@ describe('Header Component', () => {
351351
/>
352352
</TestWrapper>,
353353
)
354-
expect(screen.getByText('TEST ISSUER NAME')).toBeInTheDocument()
354+
expect(screen.getByText('(TEST ISSUER NAME)')).toBeInTheDocument()
355355
})
356356

357357
it('handles missing issuer name', () => {

src/containers/Token/MPT/Header/GeneralOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const GeneralOverview = ({
3939
<div className="item-value account-link">
4040
<Account
4141
account={issuer}
42-
displayText={issuerName || shortenAccount(issuer)}
42+
displayText={shortenAccount(issuerName) || shortenAccount(issuer)}
4343
/>
4444
</div>
4545
</div>

src/containers/Token/MPT/Header/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
shortenMPTID,
1010
stripHttpProtocol,
1111
convertToHttpURL,
12+
shortenAccount,
1213
} from '../../../shared/utils'
1314
import { CopyableText } from '../../../shared/components/CopyableText'
1415
import DomainLink from '../../../shared/components/DomainLink'
@@ -163,9 +164,9 @@ export const Header = (props: Props) => {
163164
{/* Show issuer name if available */}
164165
{issuerName && (
165166
<div className="token-issuer-wrap">
166-
<span className="paren">(</span>
167-
<span className="issuer-name">{issuerName}</span>
168-
<span className="paren">)</span>
167+
<span className="issuer-name">
168+
({shortenAccount(issuerName)})
169+
</span>
169170
</div>
170171
)}
171172
</div>

src/containers/Token/shared/styles.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@
220220
margin-left: 5px;
221221
font-size: 42px;
222222
}
223-
224-
.paren {
225-
margin: 0;
226-
}
227223
}
228224

229225
// Box content area

0 commit comments

Comments
 (0)