Skip to content

Commit

Permalink
Merge branch 'develop' into add-theme-switching
Browse files Browse the repository at this point in the history
  • Loading branch information
benwolski authored Oct 3, 2024
2 parents 4fe78ae + 1d953eb commit eb603e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ambient-utils/api/fetchContractDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const fetchContractDetails = async (
address,
error,
});
return 18; // Default to 18 if it fails
return NaN; // preserve type but return falsy value
}),
contract.totalSupply().catch((error) => {
console.warn('Failed to fetch totalSupply:', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default function PortfolioBannerAccount(props: propsIF) {
className={styles.address_detail}
onClick={handleCopyAddress}
>
{addressToDisplay}
{addressToDisplay && addressToDisplay.length > 8 ? trimString(addressToDisplay, 5, 3) : addressToDisplay}
{addressToDisplay ? <FiCopy size={'12px'} /> : null}
{addressToDisplay ? (
<FiExternalLink
Expand Down
11 changes: 9 additions & 2 deletions src/pages/platformAmbient/Chart/Axes/xAxis/XaxisCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '../../../../../ambient-utils/dataLayer';
import {
crosshair,
isIOS,
renderCanvasArray,
scaleData,
selectedDrawnData,
Expand Down Expand Up @@ -243,7 +244,10 @@ function XAxisCanvas(props: xAxisIF) {
context.textAlign = 'center';
context.textBaseline = 'top';
context.fillStyle = 'rgba(240, 240, 248, 0.8)';
context.font = '50 11.5px Lexend Deca';
context.font =
width < 500
? '250 11.5px Lexend Deca'
: '50 11.5px Lexend Deca';
context.filter = ' blur(0px)';

const formatValue = formatDateTicks(d.date, 'tick');
Expand All @@ -256,7 +260,10 @@ function XAxisCanvas(props: xAxisIF) {
xScale(crosshairData[0].x) + _width &&
d.date !== crosshairData[0].x
) {
context.filter = ' blur(7px)';
context.filter = 'blur(7px)';
if (isIOS() && width < 500) {
return;
}
}

if (d.style) {
Expand Down
4 changes: 4 additions & 0 deletions src/pages/platformAmbient/Chart/ChartUtils/chartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ export type orderHistory = {
tokenB: string;
tokenBAmount: number;
};
export const isIOS = (): boolean => {
const userAgent = navigator.userAgent;
return /iPad|iPhone|iPod/.test(userAgent);
};

export function setCanvasResolution(canvas: HTMLCanvasElement) {
const ratio = window.devicePixelRatio < 1 ? 1 : window.devicePixelRatio;
Expand Down

0 comments on commit eb603e6

Please sign in to comment.