Skip to content

Commit

Permalink
Label oauth button for registration page
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcage committed Sep 21, 2022
1 parent 555ce67 commit e0af13a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
21 changes: 12 additions & 9 deletions app/View/Components/OauthButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@

class OauthButtons extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
public function __construct(public bool $signUp = false)
{
}

public function render(): \Illuminate\Contracts\View\View|\Closure|string
{
return view('components.oauth-buttons', [
'oauth_services' => $this->getOauthServices(),
Expand All @@ -27,9 +26,13 @@ private function getOauthServices(): array
->map(fn (string $driver) => [
'name' => $driver,
'icon' => $driver,
'label' => __('Sign in with :service', [
'service' => ucfirst($driver),
]),
'label' => $this->signUp
? __('Sign up with :service', [
'service' => ucfirst($driver),
])
: __('Sign in with :service', [
'service' => ucfirst($driver),
]),
])
->toArray();
}
Expand Down
1 change: 1 addition & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
"Thanks, <br>\n:name": "Danke, <br>\n:name",
"or": "oder",
"Sign in with :service": "Mit :service anmelden",
"Sign up with :service": "Mit :service registrieren",
"Login with :service failed. Please try again or inform the administrator.": "Login mit :service ist fehlgeschlagen. Bitte versuche es nochmals oder informiere den Administrator.",
"Only email addresses of the organization :domain are accepted.": "Es werden nur E-Mailadressen der Organisation :domain akzeptiert.",
"OAuth": "OAuth",
Expand Down
6 changes: 1 addition & 5 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

@section('content')

<x-oauth-buttons/>

<x-alert type="info">
{!! __('By using this service, you accept our <a href=":url" target="_blank">privacy policy</a>.', [ 'url' => route('userPrivacyPolicy') ]) !!}
</x-alert>
<x-oauth-buttons signUp/>

{{ Form::open(['route' => 'register']) }}

Expand Down

0 comments on commit e0af13a

Please sign in to comment.