Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
mainnet-pat committed Jul 22, 2024
1 parent 068823b commit c8def9f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
12 changes: 6 additions & 6 deletions website/src/app/dashboard/post-job-old/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ export default function PostJobPage() {
{isConfirmed && <div>Transaction confirmed.</div>}
</Fieldset>
)}
{showSummary && (
// <JobSummary
// formInputs={formInputs}
// submitJob={postJobClick}
// />
)}
{/* {showSummary && (
<JobSummary
formInputs={formInputs}
submitJob={postJobClick}
/>
)} */}
</Layout>
);
}
16 changes: 14 additions & 2 deletions website/src/app/dashboard/post-job/PostJobPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ import Image from 'next/image'
import moment from 'moment'
import TagsInput from '@/components/TagsInput'
import { BsInfoCircle } from 'react-icons/bs'
import useShortenText from '@/hooks/useShortenText'

function shortenText({text, maxLength} : {text: string | `0x${string}` | undefined, maxLength: number}) {
if (!text) return console.log("No text provided");
if (text.length <= maxLength) {
return text;
}

const partLength = Math.floor((maxLength - 3) / 2); // Subtract 3 for the ellipsis
const start = text.slice(0, partLength + 1);
const end = text.slice(-partLength + 1);

return `${start}...${end}`;
}

function PostJobPage() {
const { address } = useAccount();
Expand Down Expand Up @@ -322,7 +334,7 @@ function PostJobPage() {
{arbitratorAddresses.map((arbitratorAddress, index) => (
index > 0 &&
<ListboxOption key={index} value={arbitratorAddress}>
{`${arbitratorNames[index]} ${useShortenText({ text: arbitratorAddress, maxLength: 11 })} ${arbitratorFees[index]}%`}
{`${arbitratorNames[index]} ${shortenText({ text: arbitratorAddress, maxLength: 11 })} ${arbitratorFees[index]}%`}
</ListboxOption>
))}
</Listbox>
Expand Down

0 comments on commit c8def9f

Please sign in to comment.