feat: instagram changes
This commit is contained in:
parent
e047906c22
commit
56ec5bb6e0
|
|
@ -1,7 +1,42 @@
|
|||
import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';
|
||||
import { FC } from 'react';
|
||||
import { Select } from '@gitroom/react/form/select';
|
||||
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
|
||||
|
||||
const postType = [
|
||||
{
|
||||
value: 'post',
|
||||
label: 'Post',
|
||||
},
|
||||
{
|
||||
value: 'story',
|
||||
label: 'Story',
|
||||
},
|
||||
];
|
||||
const InstagramProvider: FC<{ values?: any }> = (props) => {
|
||||
const { watch, register, formState, control } = useSettings();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Select
|
||||
label="Post Type"
|
||||
{...register('post_type', {
|
||||
value: '',
|
||||
})}
|
||||
>
|
||||
<option value="">Select Post Type...</option>
|
||||
{postType.map((item) => (
|
||||
<option key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default withProvider(
|
||||
null,
|
||||
InstagramProvider,
|
||||
undefined,
|
||||
undefined,
|
||||
async ([firstPost, ...otherPosts]) => {
|
||||
|
|
|
|||
|
|
@ -377,4 +377,8 @@ export class InstagramProvider
|
|||
})) || []
|
||||
);
|
||||
}
|
||||
|
||||
music(accessToken: string, data: {q: string}) {
|
||||
return this.fetch(`https://graph.facebook.com/v20.0/music/search?q=${encodeURIComponent(data.q)}&access_token=${accessToken}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue