fix typos in frontend code
This commit is contained in:
committed by
Umputun
parent
6ac75031ad
commit
82f27e6b63
@@ -38,7 +38,7 @@ export const IS_STORAGE_AVAILABLE: boolean = (() => {
|
||||
})();
|
||||
|
||||
/**
|
||||
* Defines whether iframe loaded in cross origin environment
|
||||
* Defines whether iframe loaded in cross-origin environment
|
||||
* Useful for checking if some privacy restriction may be applied
|
||||
*/
|
||||
export const IS_THIRD_PARTY: boolean = (() => {
|
||||
|
||||
@@ -23,7 +23,7 @@ type Methods = {
|
||||
delete: BodylessMethod;
|
||||
};
|
||||
|
||||
/** JWT token received from server and will be send by each request, if it present */
|
||||
/** JWT token received from server and will be sent by each request, if it is present */
|
||||
let activeJwtToken: string | undefined;
|
||||
|
||||
const createFetcher = (baseUrl: string = ''): Methods => {
|
||||
|
||||
@@ -88,7 +88,7 @@ export class Comment extends Component<CommentProps, State> {
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines whether comment made by logged in user
|
||||
* Defines whether comment made by logged-in user
|
||||
*/
|
||||
isCurrentUser = (): boolean => {
|
||||
return !this.isGuest() && this.props.data.user.id === this.props.user?.id;
|
||||
|
||||
@@ -40,7 +40,7 @@ export function Profile() {
|
||||
const [error, setError] = useState(false);
|
||||
const [comments, setComments] = useState<CommentType[] | null>(null);
|
||||
const [commentsAmount, setCommentsAmount] = useState(0);
|
||||
// store skip count in ref because it don't affect the view
|
||||
// store skip count in ref because it doesn't affect the view
|
||||
const commentsSkipCountsRef = useRef(0);
|
||||
const [isSigningOut, setSigningOut] = useState(false);
|
||||
|
||||
@@ -179,7 +179,7 @@ export function Profile() {
|
||||
return (
|
||||
<div className={clsx('profile', styles.root)} ref={rootRef}>
|
||||
{/* disable jsx-a11y/no-static-element-interactions and jsx-a11y/click-events-have-key-events */}
|
||||
{/* that's fine because inside of the element we have button that will throw all events and provide all of the interactions */}
|
||||
{/* that's fine because inside the element we have button that will throw all events and provide all the interactions */}
|
||||
{/* eslint-disable-next-line */}
|
||||
<div className={clsx('profile-close-button-wrapper', styles.closeButtonWrapper)} onClick={handleClickClose}>
|
||||
<IconButton title={intl.formatMessage({ id: 'profile.close', defaultMessage: 'Close profile' })}>
|
||||
|
||||
@@ -20,6 +20,8 @@ export const getCollapsedComments = (): string[] =>
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* @param siteId site id
|
||||
* @param url url of the page with comments
|
||||
* @param info list of string of type "site-id_url_comment-id
|
||||
*/
|
||||
export const saveCollapsedComments = (siteId: string, url: string, info: Comment['id'][]): void => {
|
||||
|
||||
@@ -36,7 +36,7 @@ export function postMessageToParent(data: ParentMessage): boolean {
|
||||
* Sends message to target iframe
|
||||
*
|
||||
* @param target iframe to send data
|
||||
* @param data that will be send to iframe
|
||||
* @param data that will be sent to iframe
|
||||
* @returns request success of fail
|
||||
*/
|
||||
export function postMessageToIframe(target: HTMLIFrameElement, data: ChildMessage): boolean {
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<p>
|
||||
Our Services do not address anyone under the age of 13. We do not knowingly collect personal identifiable
|
||||
information from children under 13. In the case we discover that a child under 13 has provided us with personal
|
||||
information, we immediately delete this from our servers. If you are a parent or guardian and you are aware that
|
||||
information, we immediately delete this from our servers. If you are a parent or guardian, and you are aware that
|
||||
your child has provided us with personal information, please contact us so that we will be able to do necessary
|
||||
actions.
|
||||
</p>
|
||||
|
||||
@@ -48,7 +48,7 @@ function getLocalIdent(loaderContext, _, localName, options) {
|
||||
* Generates excludes for babel-loader
|
||||
*
|
||||
* Exclude is a module that has >=es6 code and resides in node_modules.
|
||||
* By default babel-loader ignores everything from node_modules,
|
||||
* By default, babel-loader ignores everything from node_modules,
|
||||
* so we have to exclude from ignore these modules
|
||||
*/
|
||||
const exclude = [
|
||||
|
||||
@@ -14,7 +14,7 @@ TLDR: Preact replicates React API and compatible with its libraries.
|
||||
In order to inject Remark42 widgets into websites we use `iframe` and `postMessage` for communication between a site and the widget.
|
||||
Simple widgets like [counter widget](https://remark42.com/docs/configuration/frontend/#counter-widget) can be injected as a script because it doesn't have its own interface.
|
||||
|
||||
While development we setup environment which imitates real world example. We serve the page which uses Remark42 config and inject all of the widgets on it. You can check it on our [demo site](https://demo.remark42.com/web/). After successful installation you should have the same page running locally.
|
||||
While developing, we set up environment which imitates real world example. We serve the page which uses Remark42 config and inject all the widgets on it. You can check it on our [demo site](https://demo.remark42.com/web/). After successful installation you should have the same page running locally.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -92,7 +92,7 @@ Run `pnpm build` inside `./frontend`, and result files will be saved in `./front
|
||||
- The project uses TypeScript to analyze code statically
|
||||
- The project uses Eslint and Stylelint to check the frontend code. You can manually run via `pnpm lint`
|
||||
- Git Hooks (via husky) installed automatically on `pnpm i`. They check and try to fix code style if possible, otherwise commit will be rejected
|
||||
- If you want IDE integration, you need Eslint and Stylelint plugins to be installed. Also, you have configure Eslint for work in subdirectory. For example you have to add configuration for VSCode like that `"eslint.workingDirectories": ["frontend/apps/remark42"]`
|
||||
- If you want IDE integration, you need Eslint and Stylelint plugins to be installed. Also, you have configured Eslint for work in subdirectory. For example, you have to add configuration for VSCode like that `"eslint.workingDirectories": ["frontend/apps/remark42"]`
|
||||
|
||||
## CSS Styles
|
||||
|
||||
@@ -111,7 +111,7 @@ Run `pnpm build` inside `./frontend`, and result files will be saved in `./front
|
||||
## Testing
|
||||
|
||||
- Project uses [Jest](https://jestjs.io) as test framework
|
||||
- [Testing Library](https://testing-library.com) is used as UI test utilities (there are still tests with Enzyme but we are in process of migration)
|
||||
- [Testing Library](https://testing-library.com) is used as UI test utilities (there are still tests with Enzyme, but we are in process of migration)
|
||||
- Jest checks files that match regex `\.(test|spec)\.ts(x?)$`, i.e., `comment.test.tsx`, `comment.spec.ts`
|
||||
- Tests are running on push attempt
|
||||
- Example tests can be found in `./app/components/auth/auth.spec.ts`, `./app/store/user/reducers.test.ts`
|
||||
|
||||
Reference in New Issue
Block a user