Skip to content

Commit

Permalink
Merge pull request #2 from culturecreates/feature/issue-108
Browse files Browse the repository at this point in the history
Feature/issue 108
  • Loading branch information
SyamBabu-M authored Jan 12, 2024
2 parents a2a03e1 + 85f0038 commit d4d1cd7
Show file tree
Hide file tree
Showing 39 changed files with 375 additions and 324 deletions.
14 changes: 6 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
"env": {
"browser": true,
"es2021": true,
"jest": true,
"node": true
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
Expand All @@ -21,7 +16,10 @@
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
"endOfLine": "auto",
"singleQuote": true,
"printWidth": 100,
"jsxBracketSameLine": false
}
],
"react/prop-types": "off"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/build-staging-deploy-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build and deploy develop branch to S3 Staging
on:
push:
branches:
- develop
jobs:
deploy:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
AWS_REGION: ca-central-1
WEBHOSTING_BUCKET_NAME: staging.cms-widget.footlight.io
runs-on: ubuntu-22.04
container:
image: sleavely/node-awscli:14.x
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run build
- run: aws s3 sync ./build s3://${{env.WEBHOSTING_BUCKET_NAME}}/ --acl public-read --delete --cache-control max-age=3600
13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ web_modules/
# Optional eslint cache
.eslintcache

# mac specific
# misc
.DS_Store

# dotenv environment variable files
# .env
# .env.development.local
# .env.test.local
# .env.production.local
# .env.local
.env.local
.env.development.local
.env.test.local
.env.production.local

5 changes: 3 additions & 2 deletions prettier.rrc → .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "none",
"jsxBracketSameLine": true
"trailingComma": "all",
"jsxBracketSameLine": false,
"endOfLine": "auto"
}
17 changes: 7 additions & 10 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
// import { useTranslation } from 'react-i18next';
import Footer from "./components/footer/Footer";
import ResultPanel from "./components/panel/Panel";
import Search from "./components/search/Search";
import { ThemeProvider } from "./context/ThemeContext";
import { WidgetContextProvider } from "./context/WidgetContext";
import "./App.css";
import Footer from './components/footer/Footer';
import ResultPanel from './components/panel/Panel';
import Search from './components/search/Search';
import { ThemeProvider } from './context/ThemeContext';
import { WidgetContextProvider } from './context/WidgetContext';
import './App.css';

function App(props) {
const { color, ...widgetProps } = props;
return (
<ThemeProvider color={color}>
<WidgetContextProvider widgetProps={widgetProps}>
<div
className="widget-layout"
style={{ maxHeight: window.screen.height }}
>
<div className="widget-layout" style={{ maxHeight: window.screen.height }}>
<Search />
<ResultPanel />
<Footer />
Expand Down
6 changes: 3 additions & 3 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from "@testing-library/react";
import App from "./App";
import { render, screen } from '@testing-library/react';
import App from './App';

test("renders learn react link", () => {
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
Expand Down
5 changes: 5 additions & 0 deletions src/assets/Avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 18 additions & 20 deletions src/components/calendarControl/CalendarControl.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useContext } from "react";
import { useTranslation } from "react-i18next";
import { sessionStorageVariableNames } from "../../constants/sessionStorageVariableNames";
import WidgetContext from "../../context/WidgetContext";
import "./calendarControl.css";
import React, { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { sessionStorageVariableNames } from '../../constants/sessionStorageVariableNames';
import WidgetContext from '../../context/WidgetContext';
import './calendarControl.css';

const CalendarControl = ({ setCalendarKey, setView, setActiveStartDate }) => {
const {
Expand All @@ -22,12 +22,12 @@ const CalendarControl = ({ setCalendarKey, setView, setActiveStartDate }) => {
}
setSearchDate(null);
sessionStorage.setItem(sessionStorageVariableNames.WidgetSearchDate, null);
sessionStorage.setItem(sessionStorageVariableNames.WidgetStartDate, "");
sessionStorage.setItem(sessionStorageVariableNames.WidgetEndDate, "");
sessionStorage.setItem(sessionStorageVariableNames.WidgetStartDate, '');
sessionStorage.setItem(sessionStorageVariableNames.WidgetEndDate, '');
setIsSingleDate(e.target.checked);
setStartDateSpan("");
setEndDateSpan("");
setView("month");
setStartDateSpan('');
setEndDateSpan('');
setView('month');
setActiveStartDate(new Date());
};

Expand All @@ -37,12 +37,12 @@ const CalendarControl = ({ setCalendarKey, setView, setActiveStartDate }) => {
}
setSearchDate(null);
sessionStorage.setItem(sessionStorageVariableNames.WidgetSearchDate, null);
sessionStorage.setItem(sessionStorageVariableNames.WidgetStartDate, "");
sessionStorage.setItem(sessionStorageVariableNames.WidgetEndDate, "");
setStartDateSpan("");
setEndDateSpan("");
sessionStorage.setItem(sessionStorageVariableNames.WidgetStartDate, '');
sessionStorage.setItem(sessionStorageVariableNames.WidgetEndDate, '');
setStartDateSpan('');
setEndDateSpan('');
setActiveStartDate(new Date());
setView("month");
setView('month');
};

return (
Expand All @@ -52,18 +52,16 @@ const CalendarControl = ({ setCalendarKey, setView, setActiveStartDate }) => {
<input
type="checkbox"
id="single-date-control"
style={{ height: "24px", width: "24px" }}
style={{ height: '24px', width: '24px' }}
checked={isSingleDate}
onChange={(e) => handleDateSelectionTypeChange(e)}
/>
<span></span>
{t("datepicker.rangeSelectLabel")}
{t('datepicker.rangeSelectLabel')}
</label>
</div>

<button onClick={handleDateErase}>
{t("datepicker.eraseButtonLabel")}
</button>
<button onClick={handleDateErase}>{t('datepicker.eraseButtonLabel')}</button>
</div>
);
};
Expand Down
30 changes: 7 additions & 23 deletions src/components/calendarControl/calendarControl.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,23 @@
color: var(--primary-black);
}

#calendar-widget > .widget-layout .calendar-control input[type="checkbox"] {
#calendar-widget > .widget-layout .calendar-control input[type='checkbox'] {
position: absolute;
opacity: 0;
z-index: -1;
accent-color: rgb(143, 31, 31);
}

/* Text color for the label */
#calendar-widget
> .widget-layout
.calendar-control
input[type="checkbox"]
+ span {
#calendar-widget > .widget-layout .calendar-control input[type='checkbox'] + span {
cursor: pointer;
font: 16px sans-serif;
color: var(--primary-black);
}

/* Checkbox un-checked style */
#calendar-widget
> .widget-layout
.calendar-control
input[type="checkbox"]
+ span:before {
content: "";
#calendar-widget > .widget-layout .calendar-control input[type='checkbox'] + span:before {
content: '';
background: #ffffff01;
border-radius: 2px;
display: inline-block;
Expand All @@ -64,12 +56,8 @@
}

/* Checked checkbox style (in this case the background is green #e7ffba, change this to change the color) */
#calendar-widget
> .widget-layout
.calendar-control
input[type="checkbox"]:checked
+ span:before {
background-image: url("https://cdnjs.cloudflare.com/ajax/libs/ionicons/4.5.6/collection/build/ionicons/svg/ios-checkmark.svg");
#calendar-widget > .widget-layout .calendar-control input[type='checkbox']:checked + span:before {
background-image: url('https://cdnjs.cloudflare.com/ajax/libs/ionicons/4.5.6/collection/build/ionicons/svg/ios-checkmark.svg');
background-repeat: no-repeat;
background-position: center;
background-size: 27px;
Expand All @@ -78,11 +66,7 @@
}

/* Disabled checkbox styles */
#calendar-widget
> .widget-layout
.calendar-control
input[type="checkbox"]:disabled
+ span {
#calendar-widget > .widget-layout .calendar-control input[type='checkbox']:disabled + span {
cursor: default;
color: black;
opacity: 0.5;
Expand Down
10 changes: 5 additions & 5 deletions src/components/card/Card.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from "react";
import { dateRangeFormatter } from "../../utils/dateRangeFormatter";
import placeImg from "../../assets/Location.svg";
import { ReactComponent as DefaultImg } from "../../assets/Vector.svg";
import "./card.css";
import React, { useState } from 'react';
import { dateRangeFormatter } from '../../utils/dateRangeFormatter';
import placeImg from '../../assets/Location.svg';
import { ReactComponent as DefaultImg } from '../../assets/Vector.svg';
import './card.css';

const Card = ({ name, place, image, startDate, endDate }) => {
const [imgError, setImgError] = useState(false);
Expand Down
8 changes: 1 addition & 7 deletions src/components/card/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
border-radius: 4px;
}

#calendar-widget
> .widget-layout
.card
.image-column
.default-img-container
> svg
path {
#calendar-widget > .widget-layout .card .image-column .default-img-container > svg path {
fill: var(--dynamic-color-500);
}

Expand Down
Loading

0 comments on commit d4d1cd7

Please sign in to comment.