Skip to content

Commit

Permalink
Merge pull request #266 from memser-spaceport/feat/text-editor
Browse files Browse the repository at this point in the history
fix: show less icon fix
  • Loading branch information
NivedhaSV authored Oct 7, 2024
2 parents f1900f4 + d5ef7af commit b9777c7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
15 changes: 15 additions & 0 deletions components/page/member-details/bio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Cookies from 'js-cookie';
import { toast } from 'react-toastify';
import { updateMember } from '@/services/members.service';
import { ADMIN_ROLE } from '@/utils/constants';
import Image from 'next/image';

const Bio = ({ member, userInfo }: { member: any; userInfo: any }) => {
const contentLength = 347;
Expand Down Expand Up @@ -121,11 +122,17 @@ const Bio = ({ member, userInfo }: { member: any; userInfo: any }) => {
{content?.length > clippedContent?.length && (
<button className="bioCn__content__show-more" onClick={onShowMoreClickHandler}>
show more{' '}
<span className="bioCn__content__show-more__icon">
<Image src="/icons/chevron-up.svg" alt="Edit" height={12} width={12} />
</span>
</button>
)}
{content?.length > contentLength && content === clippedContent && (
<button className="bioCn__content__show-less" onClick={onShowLessClickHandler}>
show less
<span className="bioCn__content__show-more__icon">
<Image src="/icons/showless.svg" alt="Edit" height={12} width={12} />
</span>
</button>
)}
</div>
Expand Down Expand Up @@ -191,6 +198,14 @@ const Bio = ({ member, userInfo }: { member: any; userInfo: any }) => {
align-items: center;
padding-bottom: 16px;
}
.bioCn__content__show-more__icon {
top: 2px;
position: relative;
width: 12px;
height: 12px;
display: inline-block;
margin-left: 4px;
}
@media (min-width: 1024px) {
.bioCn {
Expand Down
15 changes: 15 additions & 0 deletions components/page/project-details/description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const Description = (props: IDescription) => {
const res = await updateProject(project?.id, { ...project,description: description }, authToken);
if (res.status === 200 || res.status === 201) {
setDescription(description);
setDesc(getContent(description));
triggerLoader(false);
toast.success('Description updated successfully.');
analytics.recordDescSave('save-success', getAnalyticsUserInfo(props?.user), { ...project,description: description });
Expand Down Expand Up @@ -111,6 +112,9 @@ const Description = (props: IDescription) => {
<span>
<button className="desc__content__show-more" onClick={onShowMoreClickHandler}>
show more{' '}
<span className="desc__content__show-more__icon">
<Image src="/icons/chevron-up.svg" alt="Edit" height={12} width={12} />
</span>
</button>
</span>
)}
Expand All @@ -119,6 +123,9 @@ const Description = (props: IDescription) => {
&nbsp;
<button className="desc__content__show-less" onClick={onShowLessClickHandler}>
show less
<span className="desc__content__show-more__icon">
<Image src="/icons/showless.svg" alt="Edit" height={12} width={12} />
</span>
</button>
</span>
)}
Expand Down Expand Up @@ -169,6 +176,14 @@ const Description = (props: IDescription) => {
word-break: break-word;
}
.desc__content__show-more__icon {
top: 2px;
position: relative;
width: 12px;
height: 12px;
display: inline-block;
margin-left: 4px;
}
.desc__content__show-more {
color: #156ff7;
font-size: 14px;
Expand Down
19 changes: 17 additions & 2 deletions components/page/team-details/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const About = (props: IAbout) => {
analytics.recordAboutSave('save-error', getAnalyticsUserInfo(userInfo), payload);
} else {
setAboutContent(aboutEditedContent);
setAbout(getContent(aboutContent));
setAbout(getContent(aboutEditedContent));
toast.success('Team updated successfully');
analytics.recordAboutSave('save-success', getAnalyticsUserInfo(userInfo), payload);
}
Expand Down Expand Up @@ -125,6 +125,9 @@ const About = (props: IAbout) => {
<span>
<button className="about__content__show-more" onClick={onShowMoreClickHandler}>
show more
<span className="about__content__show-more__icon">
<Image src="/icons/chevron-up.svg" alt="Edit" height={12} width={12} />
</span>
</button>
</span>
)}
Expand All @@ -133,6 +136,9 @@ const About = (props: IAbout) => {
&nbsp;
<button className="about__content__show-less" onClick={onShowLessClickHandler}>
show less
<span className="about__content__show-more__icon">
<Image src="/icons/showless.svg" alt="Edit" height={12} width={12} />
</span>
</button>
</span>
)}
Expand Down Expand Up @@ -179,6 +185,15 @@ const About = (props: IAbout) => {
gap: 8px;
}
.about__content__show-more__icon {
top: 2px;
position: relative;
width: 12px;
height: 12px;
display: inline-block;
margin-left: 4px;
}
.about__content {
color: #0f172a;
font-size: 15px;
Expand All @@ -199,7 +214,7 @@ const About = (props: IAbout) => {
.about__content__show-less {
color: #156ff7;
font-size: 14px;
font-size: 14px;
font-weight: 500;
line-height: 14px;
padding: 0;
Expand Down
3 changes: 3 additions & 0 deletions public/icons/chevron-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/showless.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b9777c7

Please sign in to comment.