Skip to content

Commit

Permalink
Add mc tab (#609)
Browse files Browse the repository at this point in the history
* add meme cooking tab

* update auto token logic

* add MC tag for image

* update

---------

Co-authored-by: naturexie <[email protected]>
  • Loading branch information
xieqiancaosissi and naturexie authored Sep 27, 2024
1 parent 21a7cc2 commit db58945
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
22 changes: 21 additions & 1 deletion src/components/forms/SelectToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export function SingleToken({ token }: { token: TokenMetadata }) {
const is_native_token = configV2.NATIVE_TOKENS.includes(token?.id);
const [showTooltip, setShowTooltip] = useState(false);
const isTokenAtRisk = !!token.isRisk;

const mark = getImageMark(token);
return (
<>
Expand Down Expand Up @@ -911,6 +910,27 @@ export default function SelectToken({
<CustomTooltip id="tknId" />
</div>
</div>
<div
className={`text-center px-2.5 py-2 ${
activeTab === 'MC'
? 'text-white bg-primaryOrderly bg-opacity-20 rounded-lg'
: ''
}`}
onClick={() => setActiveTab('MC')}
>
MC
<div
className="text-white text-right ml-1 inline-block"
data-class="reactTip"
data-tooltip-id="mcId"
data-place="left"
data-tooltip-html={memeCookingTip}
>
<QuestionMark></QuestionMark>
<CustomTooltip id="mcId" />
</div>
</div>
{/* tknx */}
{/* <div
className={`text-center px-2.5 py-2 ${
activeTab === 'MC'
Expand Down
1 change: 0 additions & 1 deletion src/components/stableswap/CommonComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export const TknImages = ({
: token?.icon;
const id = token?.id;
const isRisk = riskTokens.some((riskToken) => riskToken.id === id);

const mark = getImageMark(token, isRisk);
if (icon)
return (
Expand Down
1 change: 0 additions & 1 deletion src/components/tokens/CommonBasses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function Token({ token, price }: { token: TokenMetadata; price: string }) {
);
getLatestCommonBassesTokens();
}

const mark = getImageMark(token);
return (
<div
Expand Down
4 changes: 2 additions & 2 deletions src/components/tokens/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ export function DisplayIcon({
token: TokenMetadata;
}) {
const style = {
height: height,
width: width,
height,
width,
};

if (!token.icon) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,6 @@ function MobilePoolRowV2({
<div className="flex items-center">
{curRowTokens.map((token, index) => {
const atRisk = isTokenAtRisk(token);

const riskMark = getImageMark(token, atRisk);
return (
<div key={token.id} className="relative inline-block">
Expand Down
2 changes: 1 addition & 1 deletion src/utils/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function getImageMark(token: TokenMetadata, isRisk?: boolean) {
const isMemeCooking = isSuffix(token.id, 'meme-cooking');
if (isRisk || token.isRisk) {
if (isTkn) return 'TKN';
if (isMemeCooking) return 'MC';
if (isTknx) return 'TKNX';
// if (isMemeCooking) return 'MC';
}
return '';
}
Expand Down

0 comments on commit db58945

Please sign in to comment.