Skip to content

Commit

Permalink
refactor: remove country switcher (#303)
Browse files Browse the repository at this point in the history
The country switcher is non-functional and confusing. Besides,
the only possibile country specific section in publiccode.yml is "it" as of now.

Fix #151.
  • Loading branch information
bfabio authored Jan 30, 2024
1 parent ce8f3b0 commit 8f6520d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 58 deletions.
41 changes: 0 additions & 41 deletions src/app/components/CountrySwitcher.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions src/app/components/EditorForm.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DefaultTheme as Widgets } from "../form";
import renderField from "../form/renderField";
import CountrySwitcher from "./CountrySwitcher";
import Collapse from "rc-collapse";
import img_x from "../../asset/img/x.svg";
import img_accordion_open from "../../asset/img/accordion-open.svg";
Expand Down Expand Up @@ -54,12 +53,10 @@ const renderHeader = (props) => {
const renderBlocks = (
blocks,
activeSection,
countryProps,
sectionsWithErrors,
t
) => {
return blocks.map((block, i) => {
const last = blocks.length === i + 1;
const hasError = sectionsWithErrors.indexOf(i) >= 0;
const c = {
showArrow: false,
Expand All @@ -75,7 +72,6 @@ const renderBlocks = (
...c,
label: renderHeader({ block, hasError, activeSection, t }),
children: [
last && <CountrySwitcher key="cs" {...countryProps} />,
<div className="block" key="div">
{renderBlockItems(block.items, i, t)}
</div>,
Expand All @@ -88,8 +84,6 @@ const EditorForm = (props) => {
const {
data,
activeSection,
country,
switchCountry,
allFields,
submit,
formMethods,
Expand All @@ -98,8 +92,6 @@ const EditorForm = (props) => {
} = props;
const { t } = useTranslation();

const countryProps = { country, switchCountry };

const params = {
accordion: true,
defaultActiveKey: "0",
Expand Down Expand Up @@ -134,7 +126,6 @@ const EditorForm = (props) => {
items={renderBlocks(
data,
activeSection,
countryProps,
sectionsWithErrors,
t
)}
Expand All @@ -151,8 +142,6 @@ export default EditorForm;
EditorForm.propTypes = {
data: PropTypes.array.isRequired,
activeSection: PropTypes.arrayOf(PropTypes.string),
country: PropTypes.string.isRequired,
// switchCountry: PropTypes.func.isRequired,
allFields: PropTypes.array.isRequired,
submit: PropTypes.func.isRequired,
formMethods: PropTypes.object.isRequired,
Expand Down
6 changes: 0 additions & 6 deletions src/asset/language_switcher.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.country-switcher {
min-height: 80px;
z-index: 999;
}

.language-switcher {
display: flex;
border-bottom: 1px solid #e8e8e8;
Expand Down Expand Up @@ -100,5 +95,4 @@ input[type="text"].language-filter__input {
font-size: 18px;
font-weight: 500;
margin-left: -10px;
//text-transform: capitalize;
}

0 comments on commit 8f6520d

Please sign in to comment.