Skip to content

Commit

Permalink
minor ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohitkk432 committed Jul 29, 2023
1 parent 6cfdc68 commit c1d050d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 25 deletions.
36 changes: 16 additions & 20 deletions src/components/issues/open-issues-expand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ const OpenIssueExpand: React.FC<OpenIssueExpandProps> = ({
const [selectedPR, setSelectedPR] = useState<any>();

const userInfo = useAppSelector((state) => state.userInfo.githubInfo);
const [userTokenInfo, setUserTokenInfo] = useState<any>(null);
const [userTokenInfo, setUserTokenInfo] = useState<any>();

const refetchPart = useAppSelector((state)=> state.refetch.refetchPart);
const refetchPart = useAppSelector((state) => state.refetch.refetchPart);

const [PRSort, setPRSort] = useState<any>([
{
Expand Down Expand Up @@ -762,8 +762,10 @@ const OpenIssueExpand: React.FC<OpenIssueExpandProps> = ({
}, [link]);

useEffect(() => {
if(refetchPart==='issue'){
setTokenStakingState();
if (refetchPart === 'issue') {
setTimeout(() => {
setTokenStakingState();
}, 1000);
setStakeAmount(0);
setPRStakeAmount(0);
}
Expand Down Expand Up @@ -822,12 +824,7 @@ const OpenIssueExpand: React.FC<OpenIssueExpandProps> = ({
shape="rounded"
onClick={handleIssueStake}
isLoading={stateLoading === 'loading'}
disabled={
userTokenInfo === null ||
parseInt(userTokenInfo.amount) /
10 ** userTokenInfo.decimals ===
0
}
disabled={userTokenInfo === null}
>
Stake
</Button>
Expand All @@ -845,10 +842,12 @@ const OpenIssueExpand: React.FC<OpenIssueExpandProps> = ({
<div className="mt-3">
{userTokenInfo === null
? "User doesn't have tokens."
: userTokenInfo.amount && userTokenInfo.decimals
: userTokenInfo !== undefined &&
userTokenInfo.amount &&
userTokenInfo.decimals
? `Balance: ${
parseInt(userTokenInfo.amount) /
10 ** userTokenInfo.decimals
parseInt(userTokenInfo?.amount) /
10 ** userTokenInfo?.decimals
}`
: null}
</div>
Expand Down Expand Up @@ -898,12 +897,7 @@ const OpenIssueExpand: React.FC<OpenIssueExpandProps> = ({
shape="rounded"
onClick={handlePRStake}
isLoading={stateLoading === 'loading'}
disabled={
userTokenInfo === null ||
parseInt(userTokenInfo.amount) /
10 ** userTokenInfo.decimals ===
0
}
disabled={userTokenInfo === null}
>
Stake
</Button>
Expand All @@ -921,7 +915,9 @@ const OpenIssueExpand: React.FC<OpenIssueExpandProps> = ({
<div className="mt-3">
{userTokenInfo === null
? "User doesn't have tokens."
: userTokenInfo.amount && userTokenInfo.decimals
: userTokenInfo !== undefined &&
userTokenInfo?.amount &&
userTokenInfo?.decimals
? `Balance: ${
parseInt(userTokenInfo.amount) /
10 ** userTokenInfo.decimals
Expand Down
2 changes: 1 addition & 1 deletion src/components/swaps/BuyConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const BuyConsole: React.FC<BuyConsoleProps> = ({ setConsoleType }) => {
Announcement
</div>
<div className="mb-1 text-sm xl:mb-1.5 xl:text-base 3xl:mb-2 3xl:text-lg">
Between 24th July and 31st July the following devnet tokens
Between 24th July and 4th August the following devnet tokens
</div>
<div className="mb-1 flex items-center text-xs xl:mb-1.5 xl:text-sm 3xl:mb-2 3xl:text-base">
<AnchorLink
Expand Down
2 changes: 1 addition & 1 deletion src/components/swaps/SwapConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ const SwapConsole: React.FC<SwapConsoleProps> = ({ setConsoleType }) => {
Announcement
</div>
<div className="mb-1 text-sm xl:mb-1.5 xl:text-base 3xl:mb-2 3xl:text-lg">
Between 24th July and 31st July the following devnet tokens
Between 24th July and 4th August the following devnet tokens
</div>
<div className="mb-1 flex items-center text-xs xl:mb-1.5 xl:text-sm 3xl:mb-2 3xl:text-base">
<AnchorLink
Expand Down
6 changes: 3 additions & 3 deletions src/pages/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const Onboarding: React.FC<OnboardingProps> = ({}) => {
Contributor
</div>
<div className="text-wrap xl:w-68 w-64 text-center text-xs xl:text-sm 3xl:w-72 3xl:text-base">
Best if you are working on existing open source projects or
if you are working on existing open source projects or
staking money on open issues.
</div>
</div>
Expand All @@ -130,7 +130,7 @@ const Onboarding: React.FC<OnboardingProps> = ({}) => {
Repo Owner
</div>
<div className="text-wrap xl:w-68 w-64 text-center text-xs xl:text-sm 3xl:w-72 3xl:text-base">
Best for people who own and operate multiple open source
For people who own and operate multiple open source
repositories and want a management console.
</div>
</div>
Expand All @@ -141,7 +141,7 @@ const Onboarding: React.FC<OnboardingProps> = ({}) => {
setUserRole('unchoosen');
handleSumbitType();
}}
className="absolute top-5 right-5 text-sm text-gray-400 xl:text-base 3xl:text-lg"
className="absolute top-5 right-5 cursor-pointer text-sm text-gray-400 xl:text-base 3xl:text-lg"
>
Skip
</div>
Expand Down

0 comments on commit c1d050d

Please sign in to comment.