Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored CurrentHourIndicator component to use the global CSS file … #3385

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

9 changes: 5 additions & 4 deletions src/components/CurrentHourIndicator/CurrentHourIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import styles from './CurrentHourIndicator.module.css';
import styles from 'src/style/app.module.css';


/**
* A component that displays an indicator for the current hour.
Expand All @@ -8,9 +9,9 @@ import styles from './CurrentHourIndicator.module.css';
*/
const CurrentHourIndicator = (): JSX.Element => {
return (
<div className={styles.container} data-testid="container">
<div className={styles.round}></div>
<div className={styles.line}></div>
<div className={styles.currentHourIndicator_container} data-testid="container">
<div className={styles.currentHourIndicator_round}></div>
<div className={styles.currentHourIndicator_line}></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix Prettier formatting issues.

The code works correctly but has formatting issues. Run Prettier to fix the line breaks in the className and data-testid attributes.

Apply this diff to fix the formatting:

-    <div className={styles.currentHourIndicator_container} data-testid="container">
-      <div className={styles.currentHourIndicator_round}></div>
-      <div className={styles.currentHourIndicator_line}></div>
+    <div
+      className={styles.currentHourIndicator_container}
+      data-testid="container"
+    >
+      <div className={styles.currentHourIndicator_round}></div>
+      <div className={styles.currentHourIndicator_line}></div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className={styles.currentHourIndicator_container} data-testid="container">
<div className={styles.currentHourIndicator_round}></div>
<div className={styles.currentHourIndicator_line}></div>
<div
className={styles.currentHourIndicator_container}
data-testid="container"
>
<div className={styles.currentHourIndicator_round}></div>
<div className={styles.currentHourIndicator_line}></div>
🧰 Tools
🪛 eslint

[error] 12-12: Replace ·className={styles.currentHourIndicator_container}·data-testid="container" with ⏎······className={styles.currentHourIndicator_container}⏎······data-testid="container"⏎····

(prettier/prettier)

🪛 GitHub Actions: PR Workflow

[warning] Code formatting does not match Prettier standards. Run Prettier with --write to fix.

</div>
);
};
Expand Down
24 changes: 24 additions & 0 deletions src/style/app.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
/* Red Shades */
--red-delete-bg: #f8d6dc;
--red-delete-text: #ff4d4f;
--red-line-bg: #ff0000;


/* Yellow/Orange Shades */
--loader-color: #febc59;
Expand Down Expand Up @@ -226,6 +228,28 @@
margin-bottom: 3px;
}

.currentHourIndicator_container {
position: relative;
display: flex;
flex-direction: row;
top: -8px;
left: -9px;
}

.currentHourIndicator_round {
background-color: var(--red-line-bg);
border-radius: 100%;
width: 15px;
height: 15px;
}

.currentHourIndicator_line{
width: 100%;
height: 1px;
background-color: var(--red-line-bg);
margin: auto;
}

.sidebar {
z-index: 0;
padding-top: 5px;
Expand Down
Loading