Skip to content

Commit

Permalink
Simplify enum values
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernanberg committed Dec 17, 2024
1 parent 7364d7a commit e15deee
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/pronouns.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const GenderConst = {
NOT_A_PERSON = 0,
FEMALE = 1,
MALE = 2,
UNKNOWN_SINGULAR = 7,
UNKNOWN_PLURAL = 11,
UNKNOWN_SINGULAR = 3,
UNKNOWN_PLURAL = 4,
}
```

Expand Down Expand Up @@ -91,5 +91,5 @@ _Note how `reflexive` and `object` have 4 types_
0 NOT_A_PERSON they their themself this
1 FEMALE she her herself her
2 MALE he his himself him
7 UNKNOWN_SINGULAR they their themself them
11 UNKNOWN_PLURAL they their themselves them
3 UNKNOWN_SINGULAR they their themself them
4 UNKNOWN_PLURAL they their themselves them
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ exports[`Example.react renders the example 1`] = `
class="neatoSelect"
>
<option
value="11"
value="4"
>
Gender:
</option>
Expand All @@ -189,12 +189,12 @@ exports[`Example.react renders the example 1`] = `
Not a person
</option>
<option
value="11"
value="4"
>
Unknown (plural)
</option>
<option
value="7"
value="3"
>
Unknown (singular)
</option>
Expand Down
5 changes: 2 additions & 3 deletions example/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import fbteePreset from '@nkzw/babel-fbtee';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import EnumManifest from './.enum_manifest.json' with { type: 'json' };
import CommonStrings from './common_strings.json' with { type: 'json' };

const root = process.cwd();

export default defineConfig({
export default {
build: {
target: 'modules',
},
Expand All @@ -32,4 +31,4 @@ export default defineConfig({
server: {
host: true,
},
});
};
4 changes: 2 additions & 2 deletions packages/babel-plugin-fbtee/src/Gender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export enum GenderConst {
NOT_A_PERSON = 0,
FEMALE = 1,
MALE = 2,
UNKNOWN_SINGULAR = 7,
UNKNOWN_PLURAL = 11,
UNKNOWN_SINGULAR = 3,
UNKNOWN_PLURAL = 4,
}

export const Genders = [
Expand Down
8 changes: 8 additions & 0 deletions packages/fbtee/ReactTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ enum IntlVariations {
GENDER_UNKNOWN = 3,
}

enum GenderConst {
NOT_A_PERSON = 0,
FEMALE = 1,
MALE = 2,
UNKNOWN_SINGULAR = 3,
UNKNOWN_PLURAL = 4,
}

export type ParamOptions = {
/**
* `IntlVariations.GENDER_*` Pass the gender of the parameter for correctly variated text.
Expand Down
4 changes: 2 additions & 2 deletions packages/fbtee/src/GenderConst.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ enum GenderConst {
NOT_A_PERSON = 0,
FEMALE = 1,
MALE = 2,
UNKNOWN_SINGULAR = 7,
UNKNOWN_PLURAL = 11,
UNKNOWN_SINGULAR = 3,
UNKNOWN_PLURAL = 4,
}

export default GenderConst;

0 comments on commit e15deee

Please sign in to comment.