Skip to content

Commit

Permalink
Merge pull request #21 from nossas/hotfix/translate
Browse files Browse the repository at this point in the history
Tradução para Inglês
  • Loading branch information
bnd-operator authored Jun 4, 2021
2 parents feff972 + 8d0b103 commit f205ebe
Show file tree
Hide file tree
Showing 63 changed files with 3,477 additions and 4,053 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -35,4 +36,4 @@ yarn-error.log*

/.waypoint/
*.db*
.vagrant
.vagrant
29 changes: 28 additions & 1 deletion .lighthouse/jenkins-x/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ spec:
taskSpec:
metadata: {}
stepTemplate:
env:
- name: PORT
value: "3003"
- name: NODE_ENV
value: "production"
- name: NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
value: ""
- name: NEXT_PUBLIC_BONDE_API_GRAPHQL_URL
value: "ws://api-graphql.staging.bonde.org/v1/graphql"
- name: BONDE_API_GRAPHQL_URL
value: "https://api-graphql.staging.bonde.org/v1/graphql"
- name: STRIPE_SECRET_KEY
value: ""
- name: NEXT_PUBLIC_INCUBATIONS_WIDGET_ID
value: "20292"
- name: NEXT_PUBLIC_MATERIALS_WIDGET_ID
value: "20293"
- name: NEXT_PUBLIC_DONATION_WIDGET_ID
value: "24146"
- name: NEXT_PUBLIC_NEWSLETTER_WIDGET_ID
value: "24147"
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/typescript/pullrequest.yaml@versionStream
name: ""
resources:
Expand All @@ -30,8 +51,14 @@ spec:
resources: {}
- name: check-registry
resources: {}
- name: build-container-build
- image: gcr.io/kaniko-project/executor:debug-v1.3.0
name: build-container-build
resources: {}
script: |
#!/busybox/sh
source .jx/variables.sh
cp /tekton/creds-secrets/tekton-container-registry-auth/.dockerconfigjson /kaniko/.docker/config.json
/kaniko/executor $KANIKO_FLAGS --context=/workspace/source --dockerfile=Dockerfile --destination=$PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$APP_NAME:$VERSION --build-arg=NODE_ENV --build-arg=NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY --build-arg=NEXT_PUBLIC_BONDE_API_GRAPHQL_URL --build-arg=BONDE_API_GRAPHQL_URL --build-arg=STRIPE_SECRET_KEY --build-arg=NEXT_PUBLIC_INCUBATIONS_WIDGET_ID --build-arg=NEXT_PUBLIC_MATERIALS_WIDGET_ID --build-arg=NEXT_PUBLIC_DONATION_WIDGET_ID --build-arg=NEXT_PUBLIC_NEWSLETTER_WIDGET_ID
- name: promote-jx-preview
resources: {}
podTemplate: {}
Expand Down
20 changes: 20 additions & 0 deletions .lighthouse/jenkins-x/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ spec:
metadata: {}
stepTemplate:
env:
- name: PORT
value: "3003"
- name: NODE_ENV
value: "production"
- name: NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
value: ""
- name: NEXT_PUBLIC_BONDE_API_GRAPHQL_URL
value: "ws://api-graphql.staging.bonde.org/v1/graphql"
- name: BONDE_API_GRAPHQL_URL
value: "https://api-graphql.staging.bonde.org/v1/graphql"
- name: STRIPE_SECRET_KEY
value: ""
- name: NEXT_PUBLIC_INCUBATIONS_WIDGET_ID
value: "20292"
- name: NEXT_PUBLIC_MATERIALS_WIDGET_ID
value: "20293"
- name: NEXT_PUBLIC_DONATION_WIDGET_ID
value: "24146"
- name: NEXT_PUBLIC_NEWSLETTER_WIDGET_ID
value: "24147"
- name: NPM_CONFIG_USERCONFIG
value: /tekton/home/npm/.npmrc
image: uses:jenkins-x/jx3-pipeline-catalog/tasks/typescript/release.yaml@versionStream
Expand Down
12 changes: 11 additions & 1 deletion charts/nossas-org/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ canary:
labels: {}
progressDeadlineSeconds: 60
deploymentLabels: {}
env: null
env:
PORT: "3003"
NODE_ENV: "production"
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: ""
NEXT_PUBLIC_BONDE_API_GRAPHQL_URL: "ws://api-graphql.staging.bonde.org/v1/graphql"
BONDE_API_GRAPHQL_URL: "https://api-graphql.staging.bonde.org/v1/graphql"
STRIPE_SECRET_KEY: ""
NEXT_PUBLIC_INCUBATIONS_WIDGET_ID: "20292"
NEXT_PUBLIC_MATERIALS_WIDGET_ID: "20293"
NEXT_PUBLIC_DONATION_WIDGET_ID: "24146"
NEXT_PUBLIC_NEWSLETTER_WIDGET_ID: "24147"
hpa:
cpuTargetAverageUtilization: 80
enabled: false
Expand Down
11 changes: 6 additions & 5 deletions components/Accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from "react";
import Link from "next/link";
import styled from "@emotion/styled";
import {
Box,
Button,
Stack,
Heading,
Image,
Text,
Link,
Link as LinkStyled,
useDisclosure,
useOutsideClick,
} from "@chakra-ui/react";

import IconPlus from "./IconPlus";

const BoxStyled = styled(Box)`
Expand Down Expand Up @@ -47,16 +48,16 @@ export const NavigationItem: React.FC<{ data: Item }> = ({ data }) => {
maxW="650px"
>
{typeof data.title === "string" ? (
<Heading as="h2" color="blue.main" fontSize="lg" maxW="265px">
<Heading as="h2" color="blue.main" fontSize="lg">
{data.title}
</Heading>
) : (
data.title
)}
<Text>{data.about}</Text>
{data.navigation && (
<Link variant="pink" href={data.navigation.href}>
{data.navigation.title}
<Link href={data.navigation.href}>
<LinkStyled variant="pink">{data.navigation.title}</LinkStyled>
</Link>
)}
</Stack>
Expand Down
32 changes: 10 additions & 22 deletions components/Donation/CardForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { useTranslation } from "next-i18next";
import styled from "@emotion/styled";
import { Stack, Text } from "@chakra-ui/react";
import { CardElement } from "@stripe/react-stripe-js";
Expand All @@ -11,11 +12,11 @@ import SelectField from "../Form/SelectField";
export const schema = ({ t }) =>
Yup.object().shape({
cardholderName: Yup.string().required(
t("donate.form.fields.cardholderName.required")
t("donation.form.fields.cardholderName.required")
),
customDonation: Yup.number()
.min(1, t("donate.form.fields.customDonation.min"))
.required(t("donate.form.fields.customDonation.required")),
.min(5, t("donation.form.fields.customDonation.min"))
.required(t("donation.form.fields.customDonation.required")),
});

export interface CardFormValues {
Expand Down Expand Up @@ -100,7 +101,6 @@ const InputCardField = styled.div`
`;

interface FieldsProps {
t: any;
status?: string;
setStatus: any;
errors?: any;
Expand All @@ -109,13 +109,14 @@ interface FieldsProps {
}

export const Fields: React.FC<FieldsProps> = ({
t,
status,
setStatus,
errors,
setErrors,
values,
}) => {
const { t } = useTranslation("common");

return (
<Stack spacing={4}>
<InputCardField>
Expand All @@ -135,15 +136,15 @@ export const Fields: React.FC<FieldsProps> = ({
inline
name="cardholderName"
type="text"
label={t("donate.form.fields.cardholderName.label")}
placeholder={t("donate.form.fields.cardholderName.placeholder")}
label={t("donation.form.fields.cardholderName.label")}
placeholder={t("donation.form.fields.cardholderName.placeholder")}
/>
<Stack direction="row" spacing={4}>
<SelectField
flex={1.5}
inline
name="currency"
label="Moeda"
label={t("donation.form.fields.currency.label")}
options={{
items: { brl: "BRL", usd: "USD" },
type: "object",
Expand All @@ -154,14 +155,11 @@ export const Fields: React.FC<FieldsProps> = ({
inline
name="customDonation"
type="number"
label={t("donate.form.fields.customDonation.label", {
label={t("donation.form.fields.customDonation.label", {
currency: values.currency === "brl" ? "R$" : "$",
})}
/>
</Stack>
{/* <FormHelperText color="red" fontSize="xs" textAlign="left">
{(errors as any).form}
</FormHelperText> */}
<PaymentStatus status={status} errors={errors} />
</Stack>
);
Expand All @@ -177,9 +175,6 @@ export const handleSubmit = async (
actions: any,
{ stripe, elements }: StripeHooks
) => {
// try {
// setPayment({ status: "processing" });

// Create a PaymentIntent with the specified amount.
const response = await fetchPostJSON("/api/paymentIntents", {
amount: formData.customDonation,
Expand All @@ -190,7 +185,6 @@ export const handleSubmit = async (
actions.setErrors({ customDonation: response.message });
throw new Error(response.message);
}
// setPayment(response);

// Get a reference to a mounted CardElement. Elements knows how
// to find your CardElement because there can only ever be one of
Expand All @@ -214,13 +208,7 @@ export const handleSubmit = async (
form: error.message ?? "An unknown error occured",
});
throw new Error(error.message);
// setPayment({ status: "error" });
// setErrorMessage(error.message ?? "An unknown error occured");
} else if (paymentIntent) {
// setPayment(paymentIntent);
return paymentIntent;
}
// } catch (err) {
// console.log('CardForm err', { err: err.message });
// }
};
9 changes: 4 additions & 5 deletions components/Donation/DonationDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import {
} from "@chakra-ui/react";
import { Form } from "formik";

import { withTranslation } from "../../i18n";
// import { withTranslation } from "../../i18n";

interface DonationProps {
t: any;
onClick: any;
btnText: string;
isDisabled: boolean;
onSubmit?: any;
Expand All @@ -24,7 +22,6 @@ interface DonationProps {
}

const Donation: React.FC<DonationProps> = ({
t,
children,
onSubmit,
btnText,
Expand All @@ -35,6 +32,7 @@ const Donation: React.FC<DonationProps> = ({
}) => {
const { isOpen, onOpen, onClose } = disclosureOpts;
const btnRef = React.useRef();
const t = (i18nKey: string, _?: any) => i18nKey;

return (
<Form>
Expand Down Expand Up @@ -76,4 +74,5 @@ const Donation: React.FC<DonationProps> = ({
);
};

export default withTranslation("common")(Donation);
export default Donation;
// export default withTranslation("common")(Donation);
Loading

0 comments on commit f205ebe

Please sign in to comment.