Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentao-Kuang committed Oct 7, 2024
1 parent a8a0e35 commit ec6f2ac
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions packages/landing/src/components/feature.updates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ type FeatureUpdatesState = {
showModal: boolean;
};

/**
* FeatureUpdates is a re-implementation of @linzjs/lui -> LuiUpdatesSplashModal module,
* This use to enable a one off pop up screen for introduce new feature of the recent release.
*
*/
export class FeatureUpdates extends Component<FeatureUpdatesProps, FeatureUpdatesState> {
constructor(props: FeatureUpdatesProps) {
super(props);
const currentVersion = window.localStorage.getItem(this.props.id);

this.state = {
showModal: this.props.enabled && this.props.releaseVersion.trim() !== currentVersion,
};
Expand Down Expand Up @@ -85,25 +91,6 @@ export class FeatureUpdates extends Component<FeatureUpdatesProps, FeatureUpdate
);
}

WhatsNewIcon(): ReactNode {
return (
<span
className={'LuiIcon LuiIcon--md lui-feature-title-icon '}
data-icon={'ic_whats_new_updates'}
aria-label={'whats_new_icon'}
>
<img src="assets/whats_new_updates.svg" alt="whats_new_icon" className="LuiIcon__image" />
</span>
);
}
ClearIcon(): ReactNode {
return (
<span className="LuiIcon LuiIcon--md LuiIcon--interactive" data-icon="ic_clear" aria-label="cross_icon">
<img src="/assets/clear.svg" alt="cross_icon" />
</span>
);
}

FeatureImages(bigImage: string, smallImage: string): ReactNode {
return (
<div className="lui-feature-img">
Expand All @@ -128,4 +115,26 @@ export class FeatureUpdates extends Component<FeatureUpdatesProps, FeatureUpdate
</div>
);
}

// @linzjs/lui whats_new_icon re-implementation
WhatsNewIcon(): ReactNode {
return (
<span
className={'LuiIcon LuiIcon--md lui-feature-title-icon '}
data-icon={'ic_whats_new_updates'}
aria-label={'whats_new_icon'}
>
<img src="assets/whats_new_updates.svg" alt="whats_new_icon" className="LuiIcon__image" />
</span>
);
}

// @linzjs/lui cross_icon re-implementation
ClearIcon(): ReactNode {
return (
<span className="LuiIcon LuiIcon--md LuiIcon--interactive" data-icon="ic_clear" aria-label="cross_icon">
<img src="/assets/clear.svg" alt="cross_icon" />
</span>
);
}
}

0 comments on commit ec6f2ac

Please sign in to comment.